Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

HowTo - Get distance from detected edge to mask.

Greetings,

 

I've a certain problem here. We're working on a project for school. 

 

Now we have a reactangle mask on a image. We he have devided the image in 3 parts  left, top, right...

 

http://forums.ni.com/ni/attachments/ni/200/25286/1/mask.PNG

 

Now in the area's we detect a edge. Now we want to measure the distance from the mask to that certain detected edge. Now the problem is that the distance vi needs a reactangle as input and not a line for example.

 

What is the best approach (solution :P) to get what we need?

 

 

I've added our vi to this message. @the right side we use the distance vi...

0 Kudos
Message 1 of 3
(3,455 Views)

If you have an edge, it is easy to measure the distance to another line.  You just need to decide if you should use the min, max, or center distance.  Unless the lines are parallel, the distances will all be different.

 

You will probably find the tools you need to do the measurement in the geometry section of the vision palette.

 

You shouldn't expect too detailed of a solution from the forum.  After all, it is your homework, not ours.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 3
(3,453 Views)
I did not get exactly what your are looking for. But I would comment a bit: the distance of non parallel straight lines is not defined. You can calculate the distance of a point to a line by finding the orthogonal line to the straight line going thru the point. Then you can calculate and intersection of the orthogonal line with the straight line. The distance between intersection and the point is the distance of the point from the straight line. There are special VIs for this. With this you could get the distances of the corners (or the center) of the rectangle ROI to the edge. Or is your edge just one point?
0 Kudos
Message 3 of 3
(3,400 Views)