How to find the distance between regions?

7 Ansichten (letzte 30 Tage)
bob
bob am 6 Jul. 2012
Hey,
I have a BW image in which there are some regions with irregular shapes. I'd like to calculate the following information for each particle;
1- the minimum distance to other particles.
2-maximum distance to the neighboring particles
3- Average value of distance from this particles edges to the neighboring particles.
I was thinking to put a circle at the centroid of the region and then grow the radius of the circle to touch the first particle. this would be the the minimum distance. and continue again to touch the other particles and finally calculate the average value.
any ideas?

Akzeptierte Antwort

Image Analyst
Image Analyst am 6 Jul. 2012
Have you looked at bwdist()?
  13 Kommentare
bob
bob am 24 Jul. 2012
Image Analyst
Image Analyst am 24 Jul. 2012
If you're looking at the closest distance of a particle's edge to any other possible edge pixel of any other particle, then bwdist can't do that. You'd have to use bwboundaries and do a brute force approach. It's not many coordinates though, so it should be pretty fast. Let's see your code for that and we can discuss it.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by