K- Mean Clustering Algorithm Issue

조회 수: 1 (최근 30일)
rizwan
rizwan 2015년 3월 16일
편집: rizwan 2015년 3월 16일
Hi Experts, I am using the following code to find clusters in my image using K - Mean [ I map] = imread('D:\MS\Research\Classification Model\Research Implementation\EnhancedImage\ROIImage.jpeg');
I = ~I;
imshow(I,map);
[m n]=size(I)
P = [];
for i=1:m
for j=1:n
if I(i,j)==1
P = [P ; i j];
end
end
end
size(P)
MON=P;
[IDX,ctrs] = kmeans(MON,3,'display', 'iter','MaxIter',500);
clusterImage = zeros(size(I));
clusteredImage(sub2ind(size(I) , P(:,1) , P(:,2)))=IDX;
imshow(label2rgb(clusteredImage))
The out put of the above code is
>> ImageEnhancement
m =
180
n =
317
ans =
20306 2
iter phase num sum
1 1 20306 9.40619e+07
2 1 2727 7.34318e+07
3 1 876 7.1216e+07
4 1 574 7.03212e+07
5 1 410 6.98473e+07
6 1 298 6.96024e+07
7 1 173 6.95038e+07
8 1 122 6.94633e+07
9 1 65 6.945e+07
10 1 45 6.9445e+07
11 1 30 6.9443e+07
12 1 15 6.94424e+07
13 1 8 6.94422e+07
14 1 3 6.94422e+07
15 1 1 6.94422e+07
16 2 0 6.94422e+07
Best total sum of distances = 6.94422e+07
Warning: Image is too big to fit on screen; displaying at 2%
Can any one explain this out put and how can i see proper out put of K- Mean???
I shall remain thank full You To
Regards

답변 (0개)

카테고리

Help CenterFile Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by