Page 196 - Computational Colour Science Using MATLAB
P. 196
IMPLEMENTATIONS AND EXAMPLES 183
elseif strcmp(’d55___31’, obs)
cie = d55___31;
elseif strcmp(’d65___64’, obs)
cie = d65___64;
elseif strcmp(’d65___31’, obs)
cie = d65___31;
elseif strcmp(’d75___64’, obs)
cie = d75___64;
elseif strcmp(’d75___31’, obs)
cie = d75___31;
elseif strcmp(’f2___64’, obs)
cie = f2___64;
elseif strcmp(’f2___31’, obs)
cie = f2___31;
elseif strcmp(’f7___64’, obs)
cie = f7___64;
elseif strcmp(’f7___31’, obs)
cie = f7___31;
elseif strcmp(’f9___64’, obs)
cie = f9___64;
elseif strcmp(’f9___31’, obs)
cie = f9___31;
else
disp(’unknown option obs’);
disp(’use d65___64 for D65 and 1964 observer’); return;
end
% the basis functions are only available in the range
400-700 nm
M = cie(5:35,:);
M(1,:) = M(1,:) + sum(cie(1:4,:));
M(31,:) = M(31,:) + sum(cie(36:43,:));
Q = v’*M
a = XYZ*inv(v’*M)
P = a*v’;
10.5.4 Estimation of reflectance spectra from camera responses
The following MATLAB code implements the method of Imai and Berns (1999)
to predict reflectance spectra from camera RGB responses. The data that were