How to find the distance between regions?

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?

 Réponse acceptée

Image Analyst
Image Analyst le 6 Juil 2012

0 votes

Have you looked at bwdist()?

13 commentaires

bob
bob le 6 Juil 2012
No, how it works?
Image Analyst
Image Analyst le 6 Juil 2012
Modifié(e) : Image Analyst le 6 Juil 2012
It works pretty well.
Where did you upload your images to?
Did you want the distance from borders to borders or centroids to centroids?
Caleb
Caleb le 6 Juil 2012
Bob,
Along with bwdist(), read the documentation on regionprops(). Should give you anything you wanted to know about morphological analysis.
bob
bob le 10 Juil 2012
I tried it. But how can I get the data I need (as I explained above)?
Image Analyst
Image Analyst le 10 Juil 2012
bob - see my comment above.
bob
bob le 23 Juil 2012
Hi,
I tried bwdist(), and it works well. However, using bwlabel() I labeled the regions. Now I want to use bwdist() for the selective size(area or length) of the regions.But I couldn't do that.
For example for the region 1, I'd like to measure the mean distance to the neighboring regions!
Image Analyst
Image Analyst le 23 Juil 2012
I'm not sure what this means: "I want to use bwdist() for the selective size(area or length) of the regions" Have you looked at my image segmentation demo in my File Exchange? http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862 It selects objects based on criteria such as size. But it sounds like you want to find all the centroids and simply use the Pythagorean theorem to find the distance from a centroid to all the other centroids.
bob
bob le 24 Juil 2012
What I want is to calculate the distance between the edges of a region to all neighboring regions. distance between the centroids is not useful here. The photo I have is a micrograph of a material composed of some particles and the binder which is between the particles. Particles have irregular shape. so, what I want is the mean value of the thickness of the binder between particles.
-What is the mean thickness of the binder around individual particles
-What is the mean thickness of the binder for particles within the seize range of a-b.
Thank you
Image Analyst
Image Analyst le 24 Juil 2012
Is there any reason why you didn't answer my question from July 6: "Where did you upload your images to?" Are you expecting people to answer questions on image processing without an image to look at? How good do you expect those answers to be?
bob
bob le 24 Juil 2012
No, actually I just didn't notice that. How can I upload an image?
bob
bob le 24 Juil 2012
Image Analyst
Image Analyst le 24 Juil 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.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by