Page 73 - Computational Colour Science Using MATLAB
P. 73
60 COMPUTING COLOUR DIFFERENCE
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(xyz);
if (dim(1) == 1) | (dim(2) == 1)
xyz = xyz(:)’; % force to be a row matrix
else
disp(’xyz must be a row matrix’);
return;
end
if (xyz(2)/white(2) > 0.008856)
lab(1) = 116*(xyz(2)/white(2))^(1/3) - 16;
else
lab(1) = 903.3*(xyz(2)/white(2));
end
for i=1:3
if (xyz(i)/white(i) > 0.008856)
fx(i) = (xyz(i)/white(i))^(1/3);
else
fx(i) = 7.787*(xyz(i)/white(i)) + 16/116;
end
end