07-21-2010 02:31 PM
Hi All
I am using Vision Builder and would like to be able to count the objects, measure their areas, ratio the total areas of all objects to the area of the image. I haven't been able to figure out how to do this. Can anyone out there help?
I have attached a typical image -- this is after various operations on the raw image into VB. You can see the circular objects and that some are hollow. It is the areas of all objects (hollow counted as solids) in ratio to the total image area that I need.
Thanks in advance for the help.
07-21-2010 04:20 PM
Hi,
You best option in Vision Builder AI is to use the Detect Object step to compute the area of each particle, then use a combination of a Vision Assistant Step, to fill the holes, and Count Pixels to get the ratio you're interested in.
See attached inspection written in VBAI 2009 SP1.
Hope this helps.
Christophe
07-23-2010 02:03 AM - edited 07-23-2010 02:03 AM
Another approach is to fill the holes, then invert the image. This will makes the background as a single huge "particle", with n holes, where n is of course the number of original particles, and with area(bckgnd) = image area - particles area. Filling the holes you will get the whole image area.
The corresponding script is attached.
07-23-2010 12:49 PM
Hi
Thanks so much -- this put me on the exact right track.
07-23-2010 12:50 PM
Thanks very much
I'll give this a try too. I appreciate the quick reply and the help.
07-23-2010 03:56 PM
Kudos are always appreciated for helpful posts 🙂
Cheers,