How can I fill the gaps in a binary image?

6 Ansichten (letzte 30 Tage)
Hazem Al-Bulqini
Hazem Al-Bulqini am 28 Feb. 2020
Beantwortet: Guillaume am 28 Feb. 2020
I want to fill the gaps in this image and make the edges smooth. With no black islands in the while region or white islands in the black region.
I tried "bwconvhull", but it didn't conserve the shape of the image, it converted the image to a white rectangle-like shape.

Antworten (1)

Guillaume
Guillaume am 28 Feb. 2020
An imclose with a fairly large structuring element might be what you're after, something like:
imclose(yourbinaryimage, strel('disk', 10))
You might want an imopen with a smaller structuring element beforehand to remove the small white isolated islands.

Kategorien

Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange

Produkte


Version

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by