フィルターのクリア

How to Fill a 'hole' with leakage?

2 ビュー (過去 30 日間)
Subhajit Chatterjee
Subhajit Chatterjee 2015 年 9 月 25 日
コメント済み: Jeff E 2015 年 9 月 25 日
I want to fill this holes in this image. I have tried strel() and then imclose() and then imfill() holes. But it is failed to detect these holes with leakage? Please put some light on how to fill those image and make this a whole black one. Thanks
  1 件のコメント
Jeff E
Jeff E 2015 年 9 月 25 日
Try imclose, which will make a bridge between the two "leakages" and then find the holes. imclose affects other parts of the image, so adding back those holes you found and then filling in holes again will get you a more accurate result. You may need to play a bit with the size of the imclose filter as well, depending upon the size of the "leaks".
imgin = imread('breast_image_segmented_38.jpg');
imgbw = im2bw(imgin);
%take complement to adhere to convention
imgbw = imcomplement(imgbw) ;
%make bridges across small "leaks"
img_close = imclose(imgbw , strel('disk', 7));
%find holes in resulting image
holes = ~img_close & imfill(img_close, 'holes');
%add back holes to original image
img_filled = imfill((imgbw | holes) , 'holes');
%optional additional filling
img_filled_closed = imclose(img_filled, strel('disk', 3)) ;

サインインしてコメントする。

回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by