How to fill holes having area less than some maximum threshold value?
22 次查看(过去 30 天)
显示 更早的评论
I have a binary image, I want to fill only those holes having area less than say 20, and holes having area more than that remains unfilled...how can I do this...any sort of help is appreciated
0 个评论
采纳的回答
Image Analyst
2015-7-18
Invert the image so that the holes are now foreground blobs, then call bwareaopen, and invert again
binaryImage = ~bwareaopen(~binaryImage, 20);
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Recognition, Object Detection, and Semantic Segmentation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!