How can I fill the gaps in a binary image?
6 ビュー (過去 30 日間)
古いコメントを表示
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.

0 件のコメント
回答 (1 件)
Guillaume
2020 年 2 月 28 日
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.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!