How to morphologically open a binary image ?

Hello , i am trying to morphologically open(to decrease the retrieved area) a binary image . However i am getting a black image (all pixels are 0) .What is wrong ?
se=strel('disk',3);
Im_open=imopen(original_binary,se);
figure;
imshow(Im_open);

1 件のコメント

KALYAN ACHARJYA
KALYAN ACHARJYA 2020 年 11 月 21 日
Please attach original_binary image.

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

回答 (2 件)

Image Analyst
Image Analyst 2020 年 11 月 21 日

0 投票

This works just fine:
grayImage = imread('moon.tif');
subplot(2, 2, 1);
imshow(grayImage);
title('Original Gray Scale Image', 'FontSize', 15);
original_binary = imbinarize(grayImage);
subplot(2, 2, 2);
imshow(original_binary);
title('Binarized Image', 'FontSize', 15);
se=strel('disk',3, 0);
Im_open=imopen(original_binary,se);
subplot(2, 2, 3:4);
imshow(Im_open);
title('Opened Image', 'FontSize', 15);
If it doesn't for you then it's possible all your white blobs in your original image are less than 7 pixels in diameter (3 in radius). Or else your image is so big that the small things just get subsampled away for display (zoom in, in that case to see them).

6 件のコメント

Gn Gnk
Gn Gnk 2020 年 11 月 22 日
Yeah all of my white blobs are less than 7 pixels .What can i do?
Gn Gnk
Gn Gnk 2020 年 11 月 22 日
Check the image.
Image Analyst
Image Analyst 2020 年 11 月 22 日
Then don't call imopen() of course. What imopen() does is an erosion of the given radius, followed by a dilation of the given radius. But after the erosion, all your blobs are gone. There is nothing left to dilate. What made you think you should do an opening anyway? Did someone tell you to do that?
In my experience, the usual use of imopen() is to get rid of little tendrils and spurious/random hairs that are sticking out of a blob. You certainly don't have that if all your blobs are so tiny that they're only a few pixels big.
Gn Gnk
Gn Gnk 2020 年 11 月 22 日
In the project i am doing right now i have to take this binarized image and then perform the opening technique by using imopen() . I was asked to do this by the professor.
Image Analyst
Image Analyst 2020 年 11 月 23 日
OK, but then what that will do is to remove any blobs smaller than 3 pixels in radius, or 7 pixels in diameter.
Gn Gnk
Gn Gnk 2020 年 11 月 24 日
Got it ! Do you know any other function that i can use to do what i want ?For example check this binary image before and after using imopen() . This is what i want to achieve in the end.

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

asd asd
asd asd 2020 年 11 月 21 日

0 投票

Good luck with ΨΕΕ file!

1 件のコメント

Gn Gnk
Gn Gnk 2020 年 11 月 22 日
Thank you Ψηλε!

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

カテゴリ

ヘルプ センター および File ExchangeImage Processing Toolbox についてさらに検索

質問済み:

2020 年 11 月 21 日

コメント済み:

2020 年 11 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by