http://blog.csdn.net/superdont/archive/2008/11/05/3224013.aspx
转化为lab色彩空间模式后,图像的显示情况和数组大小。
%designed by superdont
%lilizong@gmail.com
%2008.11.5
clc
r=imread('E:\watermark\image\lena512.jpg');
size(r)
[l a b]=rgb2lab(r); %%%%????matlab中没有此函数
size(l)
size(a)
size(b)
% figure(1),imshow(l);
% figure(2),imshow(a);
% figure(3),imshow(b);
% figure(4),imshow(r);
figure(1),subplot(2,2,1),imshow(l,[]);
subplot(2,2,2),imshow(a,[]);
subplot(2,2,3),imshow(b,[]);
subplot(2,2,4),imshow(r,[]);
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/superdont/archive/2008/11/05/3224013.aspx
##############################################################################
另一种方法:
L=0.2126*R+0.7152*G+0.0722*B;
a=1.4749*(0.2213*R-0.3390*G+0.1177*B)+128;
b=0.6245*(0.1949*R+0.6057*G-0.8006*B)+128;
其中RGB和Lab的范围都是[0,255]