Finding the distance between two objects... Please help!
Show older comments
http://www.flickr.com/photos/25387007@N02/8536051789/in/photostream/lightbox/ I want to find the distance between the upper and the middle object at pts on the extremes and the min distance between the two. Please help me to find the same. I do not want to use the distance between the two centroids. Thanks a lot
3 Comments
Matt Kindig
on 7 Mar 2013
So to be clear you want the shortest distance between white pixels on the upper and middle objects? If so, first use bwboundaries() to find the outline of each object (i.e. the pixels on the edge). Then use a loop or cellfun or similar to calculate the distance between each boundary coordinate on one object and each boundary coordinate on the other object. Whichever pair has the smallest distance is your desired number.
Richa Nayak
on 8 Mar 2013
Richa Nayak
on 8 Mar 2013
Answers (0)
Categories
Find more on Image Segmentation in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!