如何在Matlab中将RGB图像转换为Lab Color Space?
答案 0 :(得分:15)
http://wildinformatics.blogspot.com/2010/10/rgb-to-lab-color-transformation-in.html
%load rgb image
src = 'C:\rainbow.jpg';
rgbI = imread(src);
%convert to lab
labTransformation = makecform('srgb2lab');
labI = applycform(rgbI,labTransformation);
%seperate l,a,b
l = labI(:,:,1);
a = labI(:,:,2);
b = labI(:,:,3);
figure, imshow(l) , title('l');
figure, imshow(a) , title('a');
figure, imshow(b) , title('b');