来源:http://www.mathworks.com/matlabcentral/fileexchange/24009-rgb2lab/content/RGB2Lab.m和http://www.mathworks.com/matlabcentral/fileexchange/24010-lab2rgb/content/Lab2RGB.m。
RGB2Lab:
function [L,a,b] = RGB2Lab(R,G,B)
%RGB2LAB Convert an image from RGB to CIELAB
%
% function [L, a, b] = RGB2Lab(R, G, B)
% function [L, a, b] = RGB2Lab(I)
% function I = RGB2Lab(...)
%
% RGB2Lab takes red, green, and blue matrices, or a single M x N x 3 image,
% and returns an image in the CIELAB color space. RGB values can be
% either between 0 and 1 or between 0 and 255. Values for L are in the
% range [0,100] while a and b are roughly in the range [-110,110]. The
% output is of type double.
%
% This transform is based on ITU-R Recommendation BT.709 using the D65
% white point reference. The error in transfo