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 件のコメント

Walter Roberson
Walter Roberson 2012 年 11 月 21 日
Please show your code and describe more specifically "still having problem"
Laila Hayat
Laila Hayat 2012 年 11 月 22 日
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 2012 年 11 月 22 日
What aspect of the picture do you wish to cluster on ?
Laila Hayat
Laila Hayat 2012 年 11 月 26 日
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 2012 年 11 月 26 日
onion.png is a coloured image
Daniel Shub
Daniel Shub 2012 年 11 月 26 日
Please show your work so far.
Laila Hayat
Laila Hayat 2012 年 11 月 26 日
a=imread('onion.png'); imshow(a); ab=double(a); cluster=kmeans(ab, 5); finalImage=reshape(cluster ,5); figure, imagesc(finalImage)
Laila Hayat
Laila Hayat 2012 年 11 月 26 日
code i wrote till now

回答 (0 件)

この質問は閉じられています。

タグ

質問済み:

2012 年 11 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by