


Convert CIE XYZ values to CIE LAB values
lab = vcXYZ2lab(xyz, whitepoint, flag)
Convert CIE XYZ into CIE L*a*b*. The CIELAB values are used for color
metric calculations, such as deltaE2000. The formula for XYZ to CIELAB
require knowledge of the XYZ white point as well.
XYZ can be in either XW or RGB format.
WHITEPOINT: a 3-vector of the xyz values of the white point.
CIELAB values are returned in the same format (RGB or XW) as the input
XYZ.
Read about CIELAB formulae in Wyszecki and Stiles, page 167 and other standard texts.
The Matlab image toolbox routines makecform and applycform have CIELAB
transforms. These are not the default, however, because they are not
in all versions. Instead, we default to the code we used for many
years. But by setting useOldCode = 0, you get the Matlab
implementation.
For a (very small) problem with the official formula, see
http://www.brucelindbloom.com/index.html?LContinuity.html
Examples:
vci = vcGetObject('vcimage');
[locs,rgb] = ieMacbethSelect(vci);
dataXYZ = imageRGB2xyz(vci,rgb);
whiteXYZ = dataXYZ(1,:);
lab = vcXYZ2lab(dataXYZ,whiteXYZ);
Copyright ImagEval Consultants, LLC, 2003.