How do I find the distance between two non-parallel lines?

8 次查看(过去 30 天)
I'm trying to find the distance between the red lines in the image, as pairs. I have the (x,y) co-ordinates of these red lines. What is the best way to measure the distance between each pair of red lines?
  2 个评论
Walter Roberson
Walter Roberson 2016-11-23
Minimum distance? Maximum distance? Average distance? Are they given just by endpoints or by intermediate points as well?
Image Analyst
Image Analyst 2017-8-16
Or distance as a function of image column,
or distance as a function of position along the slanted centerline?

请先登录,再进行评论。

回答(3 个)

KSSV
KSSV 2016-11-22
Using Distance formula...

Walter Roberson
Walter Roberson 2016-11-23
Provided that the lines do not cross, and using Roger's formula:
For each of the two endpoints in the first line, find the distance to the segment generated by the second pair of endpoints. Switch around and find the distance from each of the endpoints of the second segment to the segment generated by the first pair of endpoints. Take the minimum of these four distances.

Zhenyu Zhang
Zhenyu Zhang 2017-8-16
Would you please tell me how to pair lines in image?

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by