www.pudn.com > 1_FCM_S.zip > colorimageexample.m, change:2015-10-17,size:917b


clear;
% clc;
I=imread('238011.jpg');%  42049 15088_gray 62096 253036_gray 167083_gray 286092 texsar
I=double(I);
% figure(1);
% imagesc(I);
% title('Original Image');
% axis image;
% axis off;

[N1,N2,N3]=size(I);
k=5;%k为分为的数目
sigmac=10;
sigmap=150;
nsamp=50;
n=25;
threshold=0.0;
niter=5;


labels=simple(I,k,sigmac,sigmap,nsamp,n,threshold,niter);
figure,imshow(labels,[]);
% label = labels;
% index1 = find(label==1);
% index2 = find(label==2);
% index3 = find(label==3);
% index4 = find(label==4);
% index5 = find(label==5);
% index6 = find(label==6);
% label(index1) = 2;
% label(index2) = 1;
% label(index3) = 1;
% label(index4) = 2;
% label(index5) = 4;
% label(index6) = 3;
% figure,imshow(uint8((label-1)*255));

% figure(2);
% imagesc(labels);
% axis image;
% axis off;
% title('Partition Image');
% 
% figure(3);
% imagesc(meanfill(I,Iseg));
% axis image;
% axis off;
% title('Average Color Image');