
a = imread('PSWebImageBitMap0001.bmp',  'bmp');
b = double(a(:,:,2));
[pos1, pos2] = find(b > 228);
X = [pos1, pos2];

k = 3;
[gIdx,c]=k_means(X, k);
plot(X(gIdx==1,1),X(gIdx==1,2),'r.',X(gIdx==2,1),X(gIdx==2,2),'g.', X(gIdx==3,1),X(gIdx==3,2),'b.', c(:,1),c(:,2),'kx');
