please, how do we give each region a color after the segmentation ?

5 Ansichten (letzte 30 Tage)
heba sal
heba sal am 17 Nov. 2018
Beantwortet: Image Analyst am 17 Nov. 2018

Antworten (2)

Guillaume
Guillaume am 17 Nov. 2018
label2rgb is one way to do it.

Image Analyst
Image Analyst am 17 Nov. 2018
Try this:
labeledImage = bwlabel(binaryImage, 8); % Label each blob so we can make measurements of it
% labeledImage is an integer-valued image where all pixels in the blobs have values of 1, or 2, or 3, or ... etc.
imshow(labeledImage, []); % Show the gray scale image.
title('Labeled Image, from bwlabel()', 'FontSize', captionFontSize);
% Let's assign each blob a different color to visually show the user the distinct blobs.
coloredLabels = label2rgb (labeledImage, 'hsv', 'k', 'shuffle'); % pseudo random color labels
where "binaryImage" is your segmented image, or possibly you've already labeled it and labeledImage is your segmented image.

Kategorien

Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by