Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Equivalent Rectangle in Vision AI

Hi all,
I wish to use Vision AI to detect rectangular objects in an image. Rectangles of a particular aspect ratio and scale. These rectangles are randomly aligned, so I cannot use the bounding rectangle property of Particle detection to determine their aspect ratio and scales. I can successfully use the Feret Diameter to determine the maximum distance from corner to corner, but I'm not sure how to determine the aspect ratio. I've tried using the equivalent rect property, assuming it drew a rectangle of best alignment around the particle, but it doesn't seem to do that. The results I get are odd, and sometimes NaN !

So, firstly, what does the equivalent rect property actually do? (The bundled help is useless)
And secondly, how can I go about checking the aspect ratio of my detected rectangles?

Thanks everyone,
Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 1 of 5
(3,865 Views)
Can you post some images?
0 Kudos
Message 2 of 5
(3,863 Views)
sure. They all look like this snapshot showing thresholding and cleanup. The rectangle could be anywhere within the image, at any angle, but it won't be touching the edges of the image.




Message Edited by Thoric on 08-07-2008 11:07 AM
Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 3 of 5
(3,861 Views)
Thoric -

The Vision Concepts Manual (chapter 10) has a good description of the particle measurements NI Vision supports.  For Equivalent Rect, it defines it as "Rectangle with the same perimeter and area as the particle."  This seems like it would work well for your rotated rectangles, although I tried it on the image you provided and got not particularly accurate results.

Another possibility is to get the Orientation of each particle, rotate it to be aligned with the x & y axes and take the measurements again, but that sounds like it would be time consuming.

Perhaps someone with more experience could give some suggestions?

Greg Stoll
Vision R&D
National Instruments
Greg Stoll
LabVIEW R&D
0 Kudos
Message 4 of 5
(3,839 Views)
Thanks for the input Greg. In defence of my attack at NI help: my search of the NI website Product Manuals found no entry for Equivalent Rect, and the VBAI help was useless.

Technically, a Rectangle with the Same Perimeter and Area could take on many forms, surely? maybe not... Anyway, as with yourself, I get nonsense back occasionally, so have avoided its use.

I'm now determining the Perimeter and Area from the Particle tool, and checking they are both within my limits. This seems to work well enough, although I'm not entirely satisfied that I'm excluding all other rectangle shapes Smiley Indifferent

Agreed, if I could somehow determine the orientation, place a new coordinate system at the bottom left corner and caliper the height in y and width in x I'd be onto a winner. I'm not so sure where to start with that though... Smiley Sad

Thanks for your assistance! I'd rate your answer, but I don't have enough privileges yet to rate anyone Smiley Sad

Cheers,
Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 5 of 5
(3,834 Views)