Filter löschen
Filter löschen

How to fill holes having area less than some maximum threshold value?

24 Ansichten (letzte 30 Tage)
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

Akzeptierte Antwort

Image Analyst
Image Analyst am 18 Jul. 2015
Invert the image so that the holes are now foreground blobs, then call bwareaopen, and invert again
binaryImage = ~bwareaopen(~binaryImage, 20);

Weitere Antworten (0)

Kategorien

Mehr zu Recognition, Object Detection, and Semantic Segmentation finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by