Page 75 - Computational Colour Science Using MATLAB
P. 75

62                COMPUTING COLOUR DIFFERENCE

                 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)
                   white=[94.416 100.00 120.641];
                 elseif strcmp(’d75___31’, obs)
                   white=[94.072 100.00 122.638];
                 elseif strcmp(’f2___64’, obs)
                   white=[103.279 100.00 69.027];
                 elseif strcmp(’f2___31’, obs)
                   white=[99.186 100.00 67.393];
                 elseif strcmp(’f7___64’, obs)
                   white=[95.792 100.00 107.686];
                 elseif strcmp(’f7___31’, obs)
                   white=[95.041 100.00 108.747];
                 elseif strcmp(’f9___64’, obs)
                   white=[103.863 100.00 65.607];
                 elseif strcmp(’f9___31’, obs)
                   white=[100.962 100.00 64.350];
                 else
                   disp(’unknown option obs’);
                   disp(’use d65___64 for D65 and 1964 observer’); return;
                 end

                 dim = size(lab);
                 if (dim(1) == 1) | (dim(2) == 1)
                   lab = lab(:)’; % force to be a row matrix
                 else
                   disp(’lab must be a row matrix’);
                   return;
                 end

                 % compute Y
                 if (((lab(1)+16)/116)^3 > 0.008856)
                   xyz(2) = white(2)*((lab(1)+16)/116)^3;
                 else
                   xyz(2) = white(2)*lab(1)/903.3;
   70   71   72   73   74   75   76   77   78   79   80