Assigning word to different colour
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
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 件のコメント
Walter Roberson
2012 年 8 月 31 日
What "word" are you referring to in your question, that is to be assigned a different color?
kash
2012 年 8 月 31 日
kash
2012 年 8 月 31 日
Walter Roberson
2012 年 8 月 31 日
The output of idx is not colors, it is cluster numbers.
Image Analyst
2012 年 8 月 31 日
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?
回答 (1 件)
Walter Roberson
2012 年 8 月 31 日
cluster_letter = char('A' + idx - 1);
1 件のコメント
kash
2012 年 9 月 1 日
編集済み: Walter Roberson
2012 年 9 月 1 日
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!