图像在rgb和lab空间之间的转换

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]

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值