How do I find the distance between two non-parallel lines?
Mostrar comentarios más antiguos
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 comentarios
Walter Roberson
el 23 de Nov. de 2016
Minimum distance? Maximum distance? Average distance? Are they given just by endpoints or by intermediate points as well?
Image Analyst
el 16 de Ag. de 2017
Or distance as a function of image column,
or distance as a function of position along the slanted centerline?
Respuestas (3)
KSSV
el 22 de Nov. de 2016
0 votos
Using Distance formula...
2 comentarios
The Imagician
el 22 de Nov. de 2016
KSSV
el 23 de Nov. de 2016
Let data1 and data2 be two set of points, of size Nx2.
data = data1-data2 ;
dist = sqrt(data(:,1).^2+data(:,2).^2);
Walter Roberson
el 23 de Nov. de 2016
0 votos
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
el 16 de Ag. de 2017
0 votos
Would you please tell me how to pair lines in image?
1 comentario
Image Analyst
el 16 de Ag. de 2017
Exactly what does that mean? What does "to pair" mean to you?
Categorías
Más información sobre Blocked Images en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!