Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Measure convex or concave line in Vision Builder 4 AI

Is there a function in Vision Builder for Automated Inspection or LabVIEW to give a quantative measurement for the Convex or Concaveness of a "straight line"?
Otherwise any ideas about creating a number?
0 Kudos
Message 1 of 6
(4,907 Views)
Hi,

As far as I know there is no such function. I think with LabVIEW, if you search for a straight line, you get in return the coordinates of all the points found, maybe you can feed them into an "IMAQ Fit circle" and see if the radius you get is above a certain threshold to estimate the straightness and use the position of the found centre relatively to the points to see if it's concave or convex.



Hope this helps, good luck and happy wiring 🙂

Message Edité par TiTou le 08-16-2007 11:36 AM


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 2 of 6
(4,898 Views)
Hi

Are you using "Find straight line" for detection of curved edge? I would think it won't work. AFAIK, Vision Builder does not have any operator for detection of curved edges. How exactly does your edge look like? Is it a simple arc or a more complicated shape? If it was a simple arc, there would definitely exist a solution, even with internal VBAI tools.

Vladimir

View my profile on LinkedIn
0 Kudos
Message 3 of 6
(4,893 Views)
Thanks for the replies so far.
I am actually looking for a quantative measurement for 'Convexness' or 'Concaveness', not a radius, or a center of the circle.
I don't care whether the function is in VB4AI, or I have to implement in LabVIEW, I'm just not sure what to implement.
The shape in question is supposed to be a flow pattern, and so should be convex on the leading edge. If anybody has any further ideas, I would appreciate it.
I think using the points returned from the straight line might be the start of the solution, but any ideas as to the next step would be appreciated.
0 Kudos
Message 4 of 6
(4,882 Views)
Hi

At first, please don't use Find Straight Line on curved edges. It filters only those points that lie on a straight line, so you won't get all the edge points. Use IMAQ Rake instead, that one just finds the edge points and does no more processing on them.

Now let's assume you have all the edge points - contour of your shape. From IMAQ Rake the points come ordered along the edge. Now the main criterion for the shape to be convex is that for each three consecutive points, the following condition is true:
Let's mark the points p1, p2, p3. Now take the vector p1p2. Point p3 always has to be "to the right" from the direction of p1p2. To test this condition, at first compute vectors u = p1p2 and v = p1p3. Now compute the cross product of u and v (u x v). You can do it by computing u.x * v.y - u.y * v.x. If the value of the cross product is negative, the condition is true.

Let me know if I should clarify something a bit more.

Vladimir

View my profile on LinkedIn
0 Kudos
Message 5 of 6
(4,871 Views)
One more note I forgot... if the three consecutive points lie on one line, the cross product will be zero - so you might want to enable this condition as well.
Vladimir

View my profile on LinkedIn
0 Kudos
Message 6 of 6
(4,869 Views)