Binarize from MSER regions in Matlab
Afficher commentaires plus anciens
I am currently trying to detect some nuclei in an image. For that i used the detectMSERfeatures which returns MSER regions and fits my nuclei. I want to binarize those regions on the original image but i don't know how to do it. Thanks
1 commentaire
KALYAN ACHARJYA
le 13 Mai 2018
Question is not clear. Clarify?
Réponses (2)
Jonathan
le 15 Août 2018
Modifié(e) : Image Analyst
le 16 Août 2018
[regions,cc] = detectMSERFeatures(im);
mask = false(size(im));
for i=1:cc.NumObjects
mask(cc.PixelIdxList{i}) = true;
end
Image Analyst
le 16 Août 2018
Try this:
grayImage = imread('cameraman.tif');
subplot(2, 2, 1);
imshow(grayImage);
title('Original Image', 'FontSize', 20);
drawnow;
[regions, cc] = detectMSERFeatures(grayImage);
labeledImage = labelmatrix(cc);
subplot(2, 2, 2);
imshow(labeledImage)
title('LabeledImage', 'FontSize', 20);
% Apply a variety of pseudo-colors to the regions.
coloredLabelsImage = label2rgb (labeledImage, 'hsv', 'k', 'shuffle');
% Display the pseudo-colored image.
subplot(2, 2, 3);
imshow(coloredLabelsImage);
title('Labeled Regions', 'FontSize', 20);
% Create a binary mask of any region, regardless of label.
mask = labeledImage > 0;
% Display the pseudo-colored image.
subplot(2, 2, 4);
imshow(mask);
title('Mask of Any Region', 'FontSize', 20);

Catégories
En savoir plus sur Biomedical Imaging dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!