LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I need help with the shape matching of this image

I am currently using NI Vision Assisstant to help me with the logic for the VI code. So currently I have 3 diagonal rectangles and I cannot figure out how to find the shape of each of them. Attached is a screenshot of the image I have. I have it going through a Luminosity filter and then a frequency filter and then I converted it to a binary image... now I am at this point: If anyone could help me find the rectangles... that would be greatly appreciated. I am sorry for such a basic quesiton.

 

Thank you,

Yousuf M. Soliman

0 Kudos
Message 1 of 4
(4,304 Views)

Hello Yousuf,

 

There are quite a few functions that you might find useful for locating rectangles in a binarized image.  Possibilities include Shape Matching, Pattern Matching, Geometric Matching, Shape Detection, and more.  The difficulty that you will run into is the fact that your retangles are not straight edged, but are also not curved edges.  Many of the shape matching tools look for straight edges and right angles, which are not present in your image.  As such, it may be easiest to first use edge detecting tools to locate your edges, then use measurement tools to calculate area or distance.

 

I played around with your image briefly, and was able to localize the edges to within an approximation.  I used the Clamp (Rake) tool to achieve the edge localization seen in the attached screen shots.  As you can see in ClampRect.png, the edge lines drawn aren't terribly accurate, but the other images show the points used, and with some playing around you should be able to find a better approximation of the rectangle edge.  Hope this helps!

Patrick
CLA
Download All
0 Kudos
Message 2 of 4
(4,269 Views)

Hello there,

 

I am having a similar problem. I want to locate the two spheres shown in the screenshot, and output the location of both so I can find the angle between them, and the distance traveled as they are moved upward.

 

I can not seem to get the shape matching or geometric matching to easily detect these. Perhaps they are not precise enough? Also, I want to track their location, but can't find where to do this in the Vision Assistant?

 

I would appreciate help greatly!!

 

Thanks!!

0 Kudos
Message 3 of 4
(4,184 Views)

Hi REM7,

 

Could you post the image that you're trying to process? The screenshot you posted is good, but with the green box around one of the spheres, it makes it harder to tinker with the shape finding. Have you tried using the Pattern Matching step in Vision Assistant. This step will allow you to change some of the matching parameters as well (Minimum Score, Number of Matches to Find, Rotation Angle, etc.).

 

As for tracking the location of the spheres, in the Vision Assistant window, click the Select Controls button, which will then allow you to output the Shape Report, which is an array of clusters that includes the coordinates of the center of the found shape. You should then be able to use these values to track the distance traveled by each sphere.

David S.
0 Kudos
Message 4 of 4
(4,151 Views)