Assigning word to different colour
Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Ältere Kommentare anzeigen
I have a code using k means
for k = 1:(length(dirlist))
img = imread([pathname, dirlist(k).name]);
flatImg = double(reshape(img,size(img,1)*size(img,2),size(img,3)));
idx = kmeans(flatImg,3);
end
I have around 20 images ,I have specified k=3,so for each colour i need to specify a word such as A,B,C
please tell how toprocess
5 Kommentare
Walter Roberson
am 31 Aug. 2012
What "word" are you referring to in your question, that is to be assigned a different color?
kash
am 31 Aug. 2012
kash
am 31 Aug. 2012
Walter Roberson
am 31 Aug. 2012
The output of idx is not colors, it is cluster numbers.
Image Analyst
am 31 Aug. 2012
Why do you want to do this? Why not just turn it back into an image? What are you going to do with a character array?
Antworten (1)
Walter Roberson
am 31 Aug. 2012
cluster_letter = char('A' + idx - 1);
1 Kommentar
kash
am 1 Sep. 2012
Bearbeitet: Walter Roberson
am 1 Sep. 2012
Diese Frage ist geschlossen.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!