フィルターのクリア

imfill an specific hole

2 ビュー (過去 30 日間)
Silvia
Silvia 2014 年 1 月 14 日
回答済み: DGM 2023 年 12 月 31 日
Hello,
I have a problem, I have a mask with holes and I want to fill only one of them. ¿Is it possible to do that? I also have a mask of the hole. I mean, I have a mask with holes inside and I have another image which is a mask of the hole I want to remove.
Thank you

回答 (1 件)

DGM
DGM 2023 年 12 月 31 日
% a logical image with holes
mask = imread('blobs.png');
imshow(mask,'border','tight')
% select a particular hole and get a mask for it
holemask = bwselect(~mask,50,180);
imshow(holemask,'border','tight')
% combine the masks
outmask = mask | holemask;
imshow(outmask,'border','tight')

Community Treasure Hunt

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

Start Hunting!

Translated by