MATLAB Answers

How to build a class map from multiple binary images?

조회 수: 13(최근 30일)
armin nakhjiri
armin nakhjiri 25 Mar 2021
댓글: armin nakhjiri 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:

답변(1개)

KALYAN ACHARJYA
KALYAN ACHARJYA 25 Mar 2021
편집: KALYAN ACHARJYA 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
armin nakhjiri
armin nakhjiri 25 Mar 2021
Thank you; but how can I merge all 4 classes in one?

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by