Clustering the image using k means

I have detected the face and have extracted features for face such as mean ,variance ,standard deviation,
I have applied k means directly to image and have clustered,by converting to HSV,now i have to give comparison result
by applying kmeans on features extracted values on the image ,please tell how to perform this

답변 (2개)

Image Analyst
Image Analyst 2013년 1월 23일

0 개 추천

scatter() is often used to compare results by showing the clusters. Have you tried using scatter to visualize your cluster results?

댓글 수: 2

k means on image
I = imread('');
I = im2double(I);
HSV = rgb2hsv(I);
H = HSV(:,:,1); H = H(:);
S = HSV(:,:,2); S = S(:);
V = HSV(:,:,3); V = V(:);
idx = kmeans([H S V], 4);
imshow(ind2rgb(reshape(idx, size(I,1), size(I, 2)), [0 0 1; 0 0.8 0]))
k means on values
I = imread('');
I = im2double(I);
m=mean(I(:));
va=va(I(:));
r=[m va]
idx = kmeans( );
how to apply k means for r to display image like above
Image Analyst
Image Analyst 2013년 1월 24일
편집: Image Analyst 2013년 1월 24일
You said "I have applied k means" but it appears that you have not. I don't have the Statistics Toolbox so I can't try your code or develop any using kmeans(). All I can suggest is this Mathworks example: http://www.mathworks.com/products/demos/image/color_seg_k/ipexhistology.html

댓글을 달려면 로그인하십시오.

Thorsten
Thorsten 2013년 1월 24일

0 개 추천

In your example, use
kmeans(r, number_of_clusters)

댓글 수: 5

nkumar
nkumar 2013년 1월 26일
I = imread(''); I = im2double(I); m=mean(I(:)); va=var(I(:)); r=[m va] idx = kmeans(r,2 );
in idx i get only 2 values,how that cluteres image can be image can be diplayed
Image Analyst
Image Analyst 2013년 1월 26일
You asked for 2 and got 2. Did you run the Mathworks Example to see how they can be displayed?
nkumar
nkumar 2013년 1월 28일
yes but that consists of many rows and columns ,but i have only 1row and 1 column
nkumar
nkumar 2013년 2월 3일
i have a image below
i have ectracted features
features=[m v s] for an image it is dispaled as
features=[10 12 0.9]
now as in image how to perform Image clustering
please assist
Image Analyst
Image Analyst 2013년 2월 3일
I don't have the stats toolbox so I can't try anything myself. Why don't you call tech support?

댓글을 달려면 로그인하십시오.

태그

질문:

2013년 1월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by