Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

area of objects

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.

 

0 Kudos
Message 1 of 6
(3,558 Views)

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

0 Kudos
Message 2 of 6
(3,550 Views)

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.


 

Chilly Charly    (aka CC)
0 Kudos
Message 3 of 6
(3,517 Views)

Hi

 

Thanks so much -- this put me on the exact right track.

0 Kudos
Message 4 of 6
(3,495 Views)

Thanks very much

 

I'll give this a try too. I appreciate the quick reply and the help.

0 Kudos
Message 5 of 6
(3,494 Views)

Kudos are always appreciated for helpful posts 🙂

 

Cheers,

Marti C
Applications Engineer
National Instruments
NI Medical
0 Kudos
Message 6 of 6
(3,486 Views)