How to find the "true" perimeter of objects in a binary image?
Show older comments
Say, there is an object consisting of 3 pixels next to each other (■■■). If I calculate the perimeter using
sum(sum(bwperim(image)))
I get 3. But the actual perimeter (considering all sides of the object) is 8. How do I find this? Thanks.
4 Comments
Image Analyst
on 12 Oct 2015
That's a matter of definition. You could also say the perimeter is 2 or 4 or 0. What's the length of that object? 3 or 2? It's a matter of definition.
Xen
on 12 Oct 2015
Image Analyst
on 12 Oct 2015
That's too bad. Maybe some day you'll realize and understand the other ways of considering the pixels.
Optically speaking, the pixel center-to-pixel center definition is probably the most accurate, so an image of [0,1,1,1,0] would have a length of 2 rather than 3.
Xen
on 13 Oct 2015
Accepted Answer
More Answers (0)
Categories
Find more on Region and Image Properties 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!