# how to calculate the distance between two pixels?

23 visualizaciones (últimos 30 días)
sheno39 el 21 de Sept. de 2013
Comentada: ROHINI BHUTE el 20 de Mayo de 2016
find the distance between two pixels in an image..
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

vaishali el 21 de Sept. de 2013
dist=sqrt((y2-y1)^2+(x2-x1)^2);%%%% Where (x1,y1) and (x2,y2) are coordinates of two pixels
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

### Más respuestas (1)

tami el 9 de Jun. de 2014
hello, i actually have a followup question, I am trying to find a way to calculate the distance between edges of an image created by edge detection toolbox. The edges are painted white on the image, and i need to somehow calculate the distance automatically between the longest distance of each edge. For example if the edge is a square - i would like to calculate the width and length of it.
Thank you Tamir
##### 4 comentariosMostrar 2 comentarios más antiguosOcultar 2 comentarios más antiguos
tami el 9 de Jun. de 2014
About 20-30 hrs. for a seasoned programmer.
Sayfeddine Veerbeek.
ROHINI BHUTE el 20 de Mayo de 2016
if you use images in the form of matrices and command like d(i,j)=sqrt((y2(i,j)-y1(i,j))^2+(x2(i,j)-x1(i,j)^2) then it becomes easier.i am not sure but try this one.

Iniciar sesión para comentar.

### Categorías

Más información sobre Interactive Control and Callbacks en Help Center y File Exchange.

### Community Treasure Hunt

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

Start Hunting!

Translated by