@Image Analyst can you kindly help me with this?
K means Segmentation function
1 view (last 30 days)
Show older comments
Subhransu Sekhar Bhattacharjee
on 26 Apr 2021
Commented: Subhransu Sekhar Bhattacharjee
on 26 Apr 2021
clc
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');
I need to create a fucntion which replicates what imsegkmeans is doing right in this code. Could someone please explain with code.
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!