what is mean of label1,label2,.......

1 view (last 30 days)
Mohamed Nasr
Mohamed Nasr on 6 Nov 2019
clear all
close all
clc
i=imread('5.jpg');
i1=rgb2gray(i);
figure(1);imshow(i)
imdata=reshape(i1,[],1);%covert into arry
imdata=double(imdata); % convert unit into double
[IDX nn]=kmeans(imdata,4); %perform Kmeans
imIDX=reshape(IDX,size(i1)); %matrix of index
figure;
subplot(2,3,1); imshow(i); title('original image');
subplot(2,3,2); imshow(imIDX,[]); title('segmented image');
subplot(2,3,3); imshow(imIDX==1,[]); title('label 1');
subplot(2,3,4); imshow(imIDX==2,[]); title('label 2');
subplot(2,3,5); imshow(imIDX==3,[]); title('label 3');
subplot(2,3,6); imshow(imIDX==4,[]); title('label 4');

Answers (0)

Community Treasure Hunt

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

Start Hunting!