Page 149 - Computational Colour Science Using MATLAB
P. 149
136 CHARACTERIZATION OF CAMERAS
In the code for lincam (Box 24) the data are normalized (assuming 8 bits per
channel) and then the size of the image is obtained. The reshape command is then
used to convert, for the example, the 127610163 data into a flatter 1282763
format. Each column of the new format holds the data for one of the R, G or
B channels. Following the polynomial transform, the data can be reshaped
back to the original 127610163 format. If a point-operation was applied
to an image and the R, G and B channels could be treated as the same, then
the reshape command would be used to generate a 3853261 structure. In
lincam, however, the polynomial transform is different for each of the three
channels.
An interesting feature of the getlincam and lincam functions is that the data
from each of the three channels are balanced for the neutral samples and this is
evident in Figure 8.2. In Table 8.1, for example, the RGB values of the brightest
neutral patch can be seen to be [160, 249, 162]. This is not ideal because such a
patch would not appear to be neutral if it was displayed on a typical monitor.
The transformed RGB values of the white patch output from lincam, however,
are [217, 218, 217]. This process may be described as channel balancing, where
the original imbalance results from the combined properties of the camera and
the spectral power distribution of the light under which the images are taken. For
certain applications, channel balancing may be a desirable property of the
linearization function implemented by getlincam although, for other applica-
tions, it would be possible to modify the function so that channel balancing did
not occur. The concept of channel balancing should not be confused with that of
white-point balancing. The latter is a property of a great number of
commercially available digital cameras and means that the brightest point in
any captured image is converted to RGB values of [255, 255, 255]. This property
is very undesirable if accurate characterization or even calibration is required
since the RGB values obtained for a given patch may vary depending upon the
properties of other patches in the image. If a digital camera performs white-point
balancing, then this property must be disabled before attempting device
characterization. Note that it is not desirable that the maximum values of the
channel outputs are only 160 and 162 for the red and blue channels (Table 8.1)
since the full 8-bit resolution of the device is not being exploited. In general, if the
gain settings of the individual channels can be adjusted, then this should be set so
that for a very white patch the channels give responses close to (but not equal to)
255.
Cheung and Westland (2004) have conducted a study of camera characteriza-
tion and specifically have compared the ability of polynomials and neural
networks to carry out this task (neural networks are described in more detail in
Chapter 9). In this study using the Agfa StudioCam camera 192 samples from the
centre of the Macbeth DC ColorChecker were used as training samples and the
24 samples of the Macbeth ColorChecker were used as test samples. The training
samples were used to train the neural network and to determine the coefficients