How to morphologically open a binary image ?
3 views (last 30 days)
Show older comments
Gn Gnk on 21 Nov 2020
Commented: Gn Gnk on 24 Nov 2020
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 ?
Image Analyst on 21 Nov 2020
This works just fine:
grayImage = imread('moon.tif');
subplot(2, 2, 1);
title('Original Gray Scale Image', 'FontSize', 15);
original_binary = imbinarize(grayImage);
subplot(2, 2, 2);
title('Binarized Image', 'FontSize', 15);
subplot(2, 2, 3:4);
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).
Find more on Image Processing Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!