K Mean Clustering Output Results Plotting

I have the following code which runs fines...
index_string = int2str(k);
Image_Path = strcat('D:\MS\Research\Classification Model\Research Implementation\EnhancedImage\ROI',index_string,'.jpeg');
I1 = imread(Image_Path);
I=double(I1);
figure
subplot(1,3,1)
imshow(I1)
subplot(1,3,2)
[idx,C] = adaptcluster_kmeans(I);
I want to show the output of K Means like this , what should i do?

댓글 수: 1

Image Analyst
Image Analyst 2015년 4월 6일
You forgot to attach an image that we can use imread() on, so we can't run your code with your image.

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

답변 (1개)

Stalin Samuel
Stalin Samuel 2015년 4월 6일

0 개 추천

댓글 수: 3

I tried this but it is saying index exceeds matrix dimensions
figure;
plot(I(idx==1,1),I(idx==1,2),'r.','MarkerSize',12)
hold on
plot(I(idx==2,1),I(idx==2,2),'b.','MarkerSize',12)
plot(C(:,1),C(:,2),'kx',...
'MarkerSize',15,'LineWidth',3)
legend('Cluster 1','Cluster 2','Centroids',...
'Location','NW')
title 'Cluster Assignments and Centroids'
hold off
Please Help!!!!!!!!!!!
Stalin Samuel
Stalin Samuel 2015년 4월 6일
check the dimensions of I
rizwan
rizwan 2015년 4월 6일
It is 206*314

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

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

질문:

2015년 4월 6일

댓글:

2015년 4월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by