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
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
카테고리
도움말 센터 및 File Exchange에서 Color Segmentation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!