フィルターのクリア

show ouput clustering images

1 回表示 (過去 30 日間)
Tomas
Tomas 2014 年 3 月 17 日
コメント済み: Image Analyst 2016 年 7 月 16 日
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.

回答 (1 件)

Image Analyst
Image Analyst 2014 年 3 月 17 日
rgb2ind() will do cluster analysis of rgb images.
  2 件のコメント
Tomas
Tomas 2014 年 3 月 17 日
編集済み: Tomas 2014 年 3 月 17 日
ok thanks, How do I use rg2ind ? for example
RGB = imread('flowers.tif');
[X,map] = rgb2ind(RGB,128);
imshow(X,map)
how to create something out of it as
H = HSV(:,:,1); H = H(:);
S = HSV(:,:,2); S = S(:);
V = HSV(:,:,3); V = V(:);
HH=[H S V];
idx = kmeans(HH, 4);
Image Analyst
Image Analyst 2016 年 7 月 16 日
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.

サインインしてコメントする。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by