Convert RGB image to label
Ältere Kommentare anzeigen
This function converts my labeled image into an RGB https://www.mathworks.com/help/images/ref/label2rgb.html Is it possible to convert an RGB image into a labeled one ? Because the algorithm I am running returns me a color per label but I need the label only.
I tried the solution posted below but it didnt give me the right results. The first image is the output of the algorithm, each cluster in the image has its own color. The second image is the result of running the code below.
BW = im2bw(I, graythresh(I));
CC = bwconncomp(BW);
L = labelmatrix(CC);
imagesc(L);


Akzeptierte Antwort
Weitere Antworten (1)
Kategorien
Mehr zu Modify Image Colors finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
