How to find the "true" perimeter of objects in a binary image?
Afficher commentaires plus anciens
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 commentaires
Image Analyst
le 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
le 12 Oct 2015
Image Analyst
le 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
le 13 Oct 2015
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Region and Image Properties dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!