im loading a pic onion.png and using function kmeans(x,k) i assigned k=5. now problem is that i cant find what 'x' is and how to use it? i want to cluster whole image based on its 5 colors. never used matlab so dont know how to use the functions
Show older comments
Code that i wrote till now
a=imread('onion.png');
imshow(a);
ab=double(a);
cluster=kmeans(ab, 5);
finalImage=reshape(cluster ,5);
figure, imagesc(finalImage)
1 Comment
Laila Hayat
on 27 Nov 2012
Accepted Answer
More Answers (0)
Categories
Find more on Color Segmentation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!