06-23-2011 06:57 PM
I need help finding a away to fill in a convex in an image. I tried using vision assistant, but did not find a feature to do so.
What I want to do looks like the image in this link:
http://flylib.com/books/1/511/1/html/2/FILES/04fig74.gif
I found something called "IMAQ Convex Hull VI", but I'm not sure how to use it. I can't find examples using this either. Does anyone know how to fill in a convex?
06-24-2011 02:00 PM
Hey EE_CS,
Here is an example that should help you get started;
The trick is to use thresholding to get a binary image, which you can then use the Convex Hull on. Here is a more complex example using the convex hull tools that you might find instructive. Hope that helps!
06-27-2011 07:43 PM
Is there a way to better control where I want the convex filled? If you look at my attached image, the left image becomes the right after trying convex hull. However, I only wanted the small convexes in black to be filled with white (I do not want the zig zag path to be filled).
06-28-2011 02:05 PM - edited 06-28-2011 02:07 PM
If you are just trying to get a cleaner edge on that image near that zig zag path, you might have more luck using Close rather than trying to fill convexes. The zig zag path is a convex, so it is always going to be filled by that tool. Check out this code;
That yields this image;
Hope that helps!
06-28-2011 05:36 PM
Thanks. The close helped a little. However, even though I used your provided example, the fill isn't nearly as nice looking as yours. Here are my results of using close.
06-29-2011 04:53 PM
I would recommend using the Vision Assistant to "prototype" your image processing. It allows you to iterate more quickly and test changes to certain parameters. You can also generate LabVIEW code with it. It is an express VI that you can find in Vision and Motion >> Vision Express >> Vision Assistant. That is how I prototyped the code I posted. Try experimenting in there to get the results you want.