Forums

Using kmeans for an image - urgent help needed

Started by sure...@gmail.com September 28, 2007
hi,
I am a beginner to Matlab. need help in using kmeans in matlab.

I have an image. lets take Lena.jpg
img=imread('Lena.jpg');
[h s v]=rgb2hsv(img); //here i get h=Hue, s=Saturation and
v=intensity of the image

now, how can i call kmeans function for h , s,v separately, what
parameters to be passed.
here h is 512*512 matrix.

and how can i construct the clustered/segmented image from the kmeans
result.
need sample code in matlab
its urgent. Please help.

Regards,
Surendiran