How to find if a binary image has some black areas with white holes?
2 次查看(过去 30 天)
显示 更早的评论
Hi. I have a binary image with a black circle. Inside black circle there is a white cicle. How to find if this my binary image has black elements with a hole inside an element?
I used bwlabel, but don't know what to do with it next
1 个评论
Image Analyst
2011-10-29
What is that? A black "element" with a hole in it would be a black region with a white blob in it. Generally black is considered background and white is considered foreground. If you have a white background and black blobs in it and some of the black blobs have white "holes" in them then you'd need to invert your image before doing what Walter says. Otherwise you can just call imclearborder (to get rid of the white background your black circle is sitting on) and see if the sum of the remaining image is greater than zero.
回答(1 个)
Walter Roberson
2011-10-29
regionprops() the Euler Number
2 个评论
Image Analyst
2011-10-30
So you have like two half circles? That would be a black disc with a line cutting across it. How is that a hole? You should post your image somewhere. See http://www.mathworks.com/matlabcentral/answers/7924-where-can-i-upload-images-and-files-for-use-on-matlab-answers
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Segmentation and Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!