Borrar filtros
Borrar filtros

Find the distance of a point from a line in an image.

1 visualización (últimos 30 días)
Kirtiman Sinha
Kirtiman Sinha el 2 de Nov. de 2017
Respondida: Roger Stafford el 2 de Nov. de 2017
Hi
I'd like to request some help. I have an noisy image with its edges detected using Sobel. I need to take each line(edge) on the image and find the distance of all points on the image(edge detected image) from those lines. The trouble I am having, is figuring out how to find the distance of points from a line. How do I identify the line? Is there any function to find the equations of a line in an image?

Respuestas (1)

Roger Stafford
Roger Stafford el 2 de Nov. de 2017
If A and B are coordinate vectors of two points on your line, and C is the vector of another point, the orthogonal distance of point C from the line AB is:
BA = B-A;
CA = C-A;
norm(CA-dot(CA,BA)/dot(BA,BA)*BA);

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by