Effacer les filtres
Effacer les filtres

find the distance from one pixel to all the pixel in image

1 vue (au cours des 30 derniers jours)
asthana
asthana le 27 Mar 2014
hello i have the one edge of image and also have centroid pixel, now i want to find the distance from centroid to all the pixel in edge. and want to store in some variable. now next wat i want to do i want to find exactly the another edge which have the distance from first edge is 1. so plz inform me that what is the code for it and plz explain me with example.
  2 commentaires
Walter Roberson
Walter Roberson le 27 Mar 2014
Are you looking for Euclidean distance?
asthana
asthana le 27 Mar 2014
yes

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 27 Mar 2014
Eucdistance = sqrt((EdgeX - CentroidX).^2 + (EdgeY - CentroidY).^2);
The edge of "exactly" distance 1 from the first edge is going to depend upon how the first edge is specified, and is going to depend upon whether the edge is certain to be horizontal, or certain to be vertical, or might be slanted. If it might be slanted then defining by a pixel list runs into some problems with definitions of distance.

Plus de réponses (0)

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by