how do i use kmeans clustering??

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? never used matlab so dont know how to use the functions

8 comentarios

Walter Roberson
Walter Roberson el 21 de Nov. de 2012
Please show your code and describe more specifically "still having problem"
Laila Hayat
Laila Hayat el 22 de Nov. de 2012
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? never used matlab so dont know how to use the function
Walter Roberson
Walter Roberson el 22 de Nov. de 2012
What aspect of the picture do you wish to cluster on ?
Laila Hayat
Laila Hayat el 26 de Nov. de 2012
1. You need to load the image ‘onion.png’ 2. Select K=5 and use Matalb function kmeans to find 5 clusters in the given image (on the basis of color). 3. Assign the colors Red, Green, Blue, Yellow and Black to each of the 5 generated classes. 4. Your result may not necessarily correspond to the actual desirable segmentation of the given image. above is the task that i have to perform
Laila Hayat
Laila Hayat el 26 de Nov. de 2012
onion.png is a coloured image
Daniel Shub
Daniel Shub el 26 de Nov. de 2012
Please show your work so far.
Laila Hayat
Laila Hayat el 26 de Nov. de 2012
a=imread('onion.png'); imshow(a); ab=double(a); cluster=kmeans(ab, 5); finalImage=reshape(cluster ,5); figure, imagesc(finalImage)
Laila Hayat
Laila Hayat el 26 de Nov. de 2012
code i wrote till now

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Preguntada:

el 21 de Nov. de 2012

Community Treasure Hunt

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

Start Hunting!

Translated by