Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

edge coordinates

Hi,
 
         I am using clamp function in vision assistant to find the distance between two edges. am converting this script to Labview vi. In few images one of the edge is not very distinct, only one point is being detected on that edge, but  the processed image shows the entire edge in red colour(similar to the edge in other images where i get multiple points on that edge). My doubt is if image is showing only one point, on what basis this line is drawn. Is there any way to find the coordinates of points on this line/edge.
 
 
~yashpal
0 Kudos
Message 1 of 4
(4,079 Views)
Hi yashpal,
The yellow points shown are all the points the VI has found that match the search criteria (inputs to the clamp function). The points chosen depend on your clamp settings - whether you are searching for the max horizontal distance, mininimum horizontal distance, or max/min vertical distances. For example, if you have it set to max horizontal distance, it finds the two yellow points that are the furthest x-coordinates apart and chooses those two points to be its edge points (these are shown as red dots along the edge rather than yellow). Then it draws straight vertical lines from each of those points to represent where those edges are.

If you examine the Edge Coordinates output of the Clamp VI, it is an array of clusters (1 DBL for x, 1 DBL for Y). The array will be empty if two suitable points were not found, or it will have a size of two, one for each of the red dots. You can see the detailed help for the Clamp VI to get more information on the settings you can vary as inputs to the VI.
0 Kudos
Message 2 of 4
(4,055 Views)

Vijay thanks for the reply.

                            can we get the pixel coordinates of this red line by any means. I want to measure the gap between the edges at a specified distance from ref. (using the clamp function.) the red dot on either edges have different y- coordiantes.  if somehow i get the pixel info of the  red line/edge i can measure the separation between them at any point, not necessarily the two dots that appear on the screen.  and if not is there any alternate way to that?

 

regards,

yashpal

 

 

 

0 Kudos
Message 3 of 4
(4,033 Views)
Hi yashpal,
For a max distance or min distance horizontal clamp (like shown in the figure on this page for a Clamp Example), the two red edges are drawn parallel to each other, exactly vertical, and perpendicular to the horizontal distance across the image. Because they are parallel, the x-distance between the lines would be the same no matter how far up or down on the lines you look at (see the Wikipedia page on parallel lines and especially the figure for Definition 1 of Euclidian parallelism). So you could just subtract the x-coordinates of the two returned coordinate pairs to get the horizontal distance. Since this is the same as the "distance" value returned by the Clamp VI, I'm not sure what you are trying to do that the VI doesn't already do. Can you elaborate more on this?

To continue the above example, if your returned coordinates were for example (33, 45) and (121, 78), the edges would extend direclty vertically from there, covering all Y-points for those x-values. So the edges would be along (33, 0), (33, 1), (33, 2)... all the way to (33,Y) and (121, 0), (121, 1)... to (121, Y), where Y is the height of the image. In algebra or geometry, this would be the same as drawing lines which are defined by x=33 and x=121.  Or you might consider the edge to only stop at the edges of the ROI/Rectangle box over which your clamp measurements take place. Then the y-coordinates wouldn't go from 0 to Y, they'd go from the first y-coordinate of the rectangle to the last y-coordinate of your rectangle box.

0 Kudos
Message 4 of 4
(4,028 Views)