How to build a class map from multiple binary images?

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:

回答 (1 件)

KALYAN ACHARJYA
KALYAN ACHARJYA 2021 年 3 月 25 日
編集済み: KALYAN ACHARJYA 2021 年 3 月 25 日

0 投票

"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 件のコメント

armin nakhjiri
armin nakhjiri 2021 年 3 月 25 日
Thank you; but how can I merge all 4 classes in one?

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

質問済み:

2021 年 3 月 25 日

コメント済み:

2021 年 3 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by