in following code instead of using rgb2lab i have to use srgb2lab, i am getting error?

1 view (last 30 days)
he = imread('peppers.png'); lab_he = rgb2lab(he);
ab = lab_he(:,:,2:3); nrows = size(ab,1); ncols = size(ab,2); ab = reshape(ab,nrows*ncols,2);
nColors = 3; % repeat the clustering 3 times to avoid local minima [cluster_idx, cluster_center] = kmeans(ab,nColors,'distance','sqEuclidean','Replicates',3);
pixel_labels = reshape(cluster_idx,nrows,ncols); figure,imshow(pixel_labels,[]), title('image labeled by cluster index');

Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!