how to measure the shortest distance from a point to the edge ?
Show older comments
Hi All,
Can somebody help me how to measure the shortest length ( Perpendicular length) from the dots indicated inside black rectangle to the edge of the black portion on both sides in the following image ?? also, how to measure the shortest length between the points indicated in blue color??
1 Comment
Walter Roberson
on 4 Jan 2012
Page not found...
Accepted Answer
More Answers (1)
Image Analyst
on 5 Jan 2012
0 votes
Use bwdist(). The max of the output image returned by bwdist() is the distance to the closest boundary. Of course this is all a guess since your link doesn't work and I can't see your image. Or use bwboundaries() and run around the boundary coordinates using Pythagorean theorem to find the distance to some know, fixed coordinate.
3 Comments
Shan Kapoor
on 6 Jan 2012
Image Analyst
on 6 Jan 2012
Really?
Image Analyst
on 7 Jan 2012
I see you finally posted the link below. Since the dots are the ultimate eroded set, which you can get from
ultimateErosion = bwulterode(originalBW);
The distance from any point, including those at the center of your circles, is given by bwdist(). I'm really puzzled as to why you think bwdist doesn't work for irregularly shaped objects. Did you try it? It does work. Just try it.
Categories
Find more on Region and Image Properties in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!