How to use dilation and closing operations to remove small objects in an image

3 次查看(过去 30 天)
Hi People,
Please, I wanna use dilation and closing operations to remove small object in an image. Please check the following images. From the picture 1.jpg to 2.jpg the result is ok if it is desired to remove the small holes while retaining the large holes, then we can simply perform a closing with a disk-shaped structuring element with a diameter larger than the smaller holes, but smaller than the large holes, with this code:
n = imread ('1.jpg');
d = strel ('disk',10); % 10 px=0.26 cm
e = imclose (n,d) ;
figure, imshow(n); figure, imshow(e);
From the picture 3 to 5.jpg, the result is not ok when using this code:
n = imread ('3.jpg');
d = strel ('disk',10); % 45 pixels = 1.19 cm, 10 px=0.26 cm
e = imclose (n,d) ;
figure, imshow(n); figure, imshow(e);
The picture 4.jpg below is what I want to get as result, and I got it by using the command bwareaopen with the removal of fewer than 350 pixels connected objects from the image. I don't wanna use bwareaopen anymore, and I wanna replace it by closing operations.
Thank you!

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 3-D Volumetric Image Processing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by