professor_rumsdiegeige Posted April 5, 2008 Report Posted April 5, 2008 Hello! Maybe this is an awkward question, but it seems to me as if Labview IMAQ doesn't have a function to mirror an image. Am I right? I've got another question, though, and that is: assuming that one has a set of pixels that describe the boundary of an object in an image (i.e. one has the border pixels, e.g. obtained by a Sobel filter with subsequent thresholding), is it possible to compute the set of pixels "inside" this boundary? Thanks a lot for your help. best regards Quote
Neville D Posted April 5, 2008 Report Posted April 5, 2008 QUOTE (professor_rumsdiegeige @ Apr 4 2008, 06:05 AM) Hello!Maybe this is an awkward question, but it seems to me as if Labview IMAQ doesn't have a function to mirror an image. Am I right? Yes it does. See the Pallet: Vision & Motion/Vision Utilities/Image Manipulation/IMAQ Symmetry.vi QUOTE (professor_rumsdiegeige @ Apr 4 2008, 06:05 AM) I've got another question, though, and that is: assuming that one has a set of pixels that describe the boundary of an object in an image (i.e. one has the border pixels, e.g. obtained by a Sobel filter with subsequent thresholding), is it possible to compute the set of pixels "inside" this boundary? What do you mean compute? Histogram? count the number of pixels? Once you have the boundary, make it into a mask and then applying that mask to the image, do whatever you want with the pixels inside it. Neville. Quote
professor_rumsdiegeige Posted April 5, 2008 Author Report Posted April 5, 2008 QUOTE (Neville D @ Apr 4 2008, 06:04 PM) Yes it does. See the Pallet: Vision & Motion/Vision Utilities/Image Manipulation/IMAQ Symmetry.viWhat do you mean compute? Histogram? count the number of pixels? Once you have the boundary, make it into a mask and then applying that mask to the image, do whatever you want with the pixels inside it. Neville. Hi, thank you for your answer. I tried IMAQ Symmetry, but evidently I got it wrong. When I use as parameter "Horizontal", it keeps on mirroring the image both in the horizontal AND in the vertical sense, which is quite weird. With "compute" I mean that I need a list of the indices or the X/Y-coordinates of the pixels inside the boundary, for instance to display all pixels inside in red color in a segmentation map. Quote
Neville D Posted April 5, 2008 Report Posted April 5, 2008 QUOTE (professor_rumsdiegeige @ Apr 4 2008, 10:11 AM) I tried IMAQ Symmetry, but evidently I got it wrong. When I use as parameter "Horizontal", it keeps on mirroring the image both in the horizontal AND in the vertical sense, which is quite weird. Hmm.. you must have made some mistake re-using some buffer that you shouldn't be.. I just tried the VI out by inserting it into my code and examing the buffer before and after the VI with it set to Horizontal. It seemed to output a mirror image along the horizontal plane. I tried it before replying, because the documentation wasn't exactly clear about what it was supposed to be doing. Maybe use a fresh (empty) destination buffer instead of rewriting to the input buffer. Maybe you have another call to the VI somewhere else.. put probes along before and after the function to see whats happening. QUOTE (professor_rumsdiegeige @ Apr 4 2008, 10:11 AM) With "compute" I mean that I need a list of the indices or the X/Y-coordinates of the pixels inside the boundary, for instance to display all pixels inside in red color in a segmentation map. Like I said, make a mask apply it and then your in business. It is always very slow (with IMAQ) to extract pixel or pt data and act on that. Use masks or ROI's to mark out a region and then process the region. Neville. Quote
professor_rumsdiegeige Posted April 6, 2008 Author Report Posted April 6, 2008 QUOTE (Neville D @ Apr 4 2008, 06:41 PM) Hmm.. you must have made some mistake re-using some buffer that you shouldn't be.. I just tried the VI out by inserting it into my code and examing the buffer before and after the VI with it set to Horizontal. It seemed to output a mirror image along the horizontal plane.I tried it before replying, because the documentation wasn't exactly clear about what it was supposed to be doing. Maybe use a fresh (empty) destination buffer instead of rewriting to the input buffer. Maybe you have another call to the VI somewhere else.. put probes along before and after the function to see whats happening. Thanks, now I got it. I mixed it up with a simultaneous call to an external DLL and it got mangled up… QUOTE (Neville D @ Apr 4 2008, 06:41 PM) Like I said, make a mask apply it and then your in business. It is always very slow (with IMAQ) to extract pixel or pt data and act on that. Use masks or ROI's to mark out a region and then process the region. As to this point, I am still confused. I agree with your mask idea, but still I would need to know which pixels have to be masked. I only know the boundary pixels, and I could mask them. But how do I know which pixels lie inside this boundary? Thank you very much again for your help. I appreciate that! Quote
Neville D Posted April 8, 2008 Report Posted April 8, 2008 QUOTE (professor_rumsdiegeige @ Apr 5 2008, 02:24 AM) I agree with your mask idea, but still I would need to know which pixels have to be masked. I only know the boundary pixels, and I could mask them. But how do I know which pixels lie inside this boundary? Can you post some code to show what boundary you have got? Rough hint: Use the boundary to generate a Region of Interest and then use the ROI to Mask VI to generate the mask. If mask is swapped use IMAQ inverse to swap the masked and unmasked regions. Check out the mask examples as well. Neville. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.