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? i want to cluster whole image based on its 5 colors. never used matlab so dont know how to use the functions
    조회 수: 4 (최근 30일)
  
       이전 댓글 표시
    
Code that i wrote till now
a=imread('onion.png');
imshow(a);
ab=double(a);
cluster=kmeans(ab, 5);
finalImage=reshape(cluster ,5);
figure, imagesc(finalImage)
채택된 답변
  Image Analyst
      
      
 2012년 11월 27일
        Do you have the stats and image processing toolboxes? If so, just follow this example: http://www.mathworks.com/products/demos/image/color_seg_k/ipexhistology.html Or else get the colors one at a time using any of the methods in my File Exchange: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
댓글 수: 0
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!