show ouput clustering images
Show older comments
Hello
I = imread('flowers','jpg');
I = im2double(I);
HSV = rgb2hsv(I);
H = HSV(:,:,1); H = H(:);
S = HSV(:,:,2); S = S(:);
V = HSV(:,:,3); V = V(:);
HH=[H S V];
idx = kmeans(HH, 4);
how i show output ?
Thanks.
Answers (1)
Image Analyst
on 17 Mar 2014
1 vote
rgb2ind() will do cluster analysis of rgb images.
2 Comments
Image Analyst
on 16 Jul 2016
rgb2ind() does the clustering itself using a variety of methods. You don't need to use kmeans afterwards, though you can use kmeans instead if you want to do it in HSV color space instead of rgb space.
Categories
Find more on Color Segmentation in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!