For this example, we assumed that your display is pretty standard (and like some of ours). These assumptions are not going to be precisely correct for your CRTs; they are not even close for printers or LCD displays.
A broad description of the issues concerning color calibration may be found in the following references:
To compute the effect of the display primaries on the cones, we need to know the spectral power distribution (SPD) of the display, and the relative absorptions of the human cones.
We include a file containing the display SPDs of one of our monitors in the file displaySPD.mat. The file contains the variables:
We usually compute with respect to the human cone estimates from Smith and Pokorny. These are represented in the file named SmithPokornyCones.mat. The file contains the following variables:
The display SPD and cone sensitivities are loaded in as:
load displaySPDThe cone sensitivities and the display spectral power distributions we have assumed are plotted below:
load SmithPokornyCones
plot(wavelength,cones);
plot(wavelength, displaySPD);
|
|
| Sample monitor SPD plot | Cone sensitivity plot |
Now, we can compute the 3 x 3 transformation that maps the linear intensity of the display r,g,b signals into the cone absorptions (l,m,s).
rgb2lms = cones'* displaySPD;
There is a nonlinear relationship between the frame-buffer values
in the image data and the intensity of the light emitted by each of
the primaries on your display. This relationship is captured by a
function commonly called the ``display gamma curve'' (a sample gamma
curve plot is shown on the right).
The file displayGamma.mat contains the variables:
To load this file:
load displayGamma
The CIELAB computation requires specifiying the white-point of the data set. In our view, each image should have its own white point. In a generally abominable practice, which we follow here, the white point is commonly set to be the white of the monitor. We don't like this much because the white point is supposed to depend on the image data, not the display device. But, nevermind.
rgbWhite = [1 1 1]';
whitepoint = rgb2lms* rgbWhite
Now that we have the gamma curve data and the transformation matrix rgb2lms ready, we can prepare our image data in the format S-CIELAB accepts.