How to build a class map from multiple binary images?
2 次查看(过去 30 天)
显示 更早的评论
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:
0 个评论
回答(1 个)
KALYAN ACHARJYA
2021-3-25
编辑:KALYAN ACHARJYA
2021-3-25
"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
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!