Filter löschen
Filter löschen

How to calculate the image distance

2 Ansichten (letzte 30 Tage)
tsai kai shung
tsai kai shung am 29 Okt. 2017
Kommentiert: Image Analyst am 30 Okt. 2017
How do I use bwdist() function to calculate the image d?

Antworten (1)

Image Analyst
Image Analyst am 29 Okt. 2017
Try this
d = bwdist(binaryImage);
The max value of (the badly-named) "d" will be the minimum distance from the centroid to the outline.
  2 Kommentare
tsai kai shung
tsai kai shung am 30 Okt. 2017
the centroid is circle centroid?
Image Analyst
Image Analyst am 30 Okt. 2017
The max of the distance transform is not necessarily located at the centroid of a blob, but for a circle it will be. If you need the centroid of an arbitrary shape use regionprops(). Then use bwboundaries to get the coordinates of all outline pixels, then use sqrt() to compute the distances and max() to find the one with max distance.

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!