I need to create a function which replicates what imsegkmean s is doing right in this code.
Fantastic news! We've Found the answer you've been seeking!
Question:
I need to create a function which replicates whatimsegkmeansis doing right in this code. Could someone please explain with code.
img = imread('peppers.png');
T= rgb2lab(img);
T = im2uint8(T);
nrows = size(T,1);
ncols = size(T,2);
[X,Y] = meshgrid(1:ncols,1:nrows);
I = cat(3,T,X,Y);
K = 6;
P = imsegkmeans(T,K);
Z = labeloverlay(T,P);
L = imsegkmeans(I,K);
J = labeloverlay(T,L);
imshowpair(Z,J,'Montage');
Posted Date: