How to build a class map from multiple binary images?

2 vues (au cours des 30 derniers jours)
armin nakhjiri
armin nakhjiri le 25 Mar 2021
Commenté : armin nakhjiri le 25 Mar 2021
Hi
I have a series of binary images (or labels) each representing a class of pixels in one image. I want to acquire an output containing all these classes with a random color asigned to each class.
like this:

Réponses (1)

KALYAN ACHARJYA
KALYAN ACHARJYA le 25 Mar 2021
Modifié(e) : KALYAN ACHARJYA le 25 Mar 2021
"I want to acquire an output containing all these classes with a random color asigned to each class"
data=rgb2gray(imread('Baboon.jpeg'));
binaryImage=imbinarize(data);
figure,imshow(binaryImage);
[labeledImage,~]=bwlabel(binaryImage,4);
coloredLabelsImage = label2rgb (labeledImage, 'hsv', 'k', 'shuffle');
figure, imshow(coloredLabelsImage);
More: See to distinguish different regions
  1 commentaire
armin nakhjiri
armin nakhjiri le 25 Mar 2021
Thank you; but how can I merge all 4 classes in one?

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by