フィルターのクリア

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

1 回表示 (過去 30 日間)
asthana
asthana 2014 年 3 月 27 日
回答済み: Walter Roberson 2014 年 3 月 27 日
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 件のコメント
Walter Roberson
Walter Roberson 2014 年 3 月 27 日
Are you looking for Euclidean distance?
asthana
asthana 2014 年 3 月 27 日
yes

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2014 年 3 月 27 日
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.

その他の回答 (0 件)

製品

Community Treasure Hunt

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

Start Hunting!

Translated by