Finding the distance between two objects... Please help!

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 件のコメント

Matt Kindig
Matt Kindig 2013 年 3 月 7 日
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
Richa Nayak 2013 年 3 月 8 日
Will it trace the curved boundaries vch r closest to each other? Coz they r the once i require. Or the dirction of the trace has to be given by us?
Richa Nayak
Richa Nayak 2013 年 3 月 8 日
I am sorry but bwboundaries for the two objects gives two arrays of different dimensions.

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

回答 (0 件)

質問済み:

2013 年 3 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by