Page 72 - Computational Colour Science Using MATLAB
P. 72

IMPLEMENTATIONS AND EXAMPLES                       59
             data are rounded to three decimal places. The quoted white points are more
             accurate than the sums of the rounded data in the columns. However, a
             consequence of the ASTM recommendation is that the CIELAB values for a
             sample with unit reflectance at every wavelength may not exactly satisfy L* ¼ 100
             and a* ¼ b* ¼ 0. For example, the XYZ values using ASTM Table 5.19
             (illuminant D65 and 1964 observer) for a perfectly reflecting sample are
             [94.809 100.00 107.307] but the ASTM white point for that illuminant/
             observer is [94.811 100.00 107.304]. Consequently, the ratios X/X , Y/Y and
                                                                          n
                                                                                n
             Z/Z for a perfectly reflecting sample are not exactly unity and the CIELAB
                 n
             L*a*b* values returned from xyz2lab are [100.0000  0.0035  0.0019].

                Box 5: xyz2lab.m

                function [lab] = xyz2lab(xyz,obs)


                % function [lab] = xyz2lab(xyz,obs)
                % computes CIELAB LAB values from XYZ tristimulus values
                % requires the illuminant/observer obs to define white
                % point
                % see function r2xyz for valid values for obs

                if strcmp(’a___64’,obs)
                  white=[111.144 100.00 35.200];
                elseif strcmp(’a___31’, obs)
                  white=[109.074 100.00 35.585];
                elseif strcmp(’c___64’, obs)
                  white=[97.285 100.00 116.145];
                elseif strcmp(’c___31’, obs)
                  white=[98.074 100.00 118.232];
                elseif strcmp(’d50___64’, obs)
                  white=[96.720 100.00 81.427];
                elseif strcmp(’d___50’, obs)
                  white=[96.422 100.00 82.521];
                elseif strcmp(’d55___64’, obs)
                  white=[95.799 100.00 90.926];
                elseif strcmp(’d55___31’, obs)
                  white=[95.682 100.00 92.149];
                elseif strcmp(’d65___64’, obs)
                  white=[94.811 100.00 107.304];
                elseif strcmp(’d65___31’, obs)
                  white=[95.047 100.00 108.883];
                elseif strcmp(’d75___64’, obs)
   67   68   69   70   71   72   73   74   75   76   77