Color
Spectral Power Distribution§
Spectral Power Distribution (SPD)
Any patch of light can be completely described by its spectrum, a SPD is represented as a plot of energy of photons per unit time for each wavelength, typically between 400 - 700 nm.
Light Detectors§
The capture of a light detector may be modelled with the following equation,
$$ X = \int n(\lambda) p(\lambda) d\lambda, $$
where
- $n(\lambda)$ is the count of incident photons at wavelength $\lambda$,
- $p(\lambda)$ is the efficiency of the detector at wavelength $\lambda$.
We again have a dimensional reduction, the SPD is a function of wavelength which is $\infty$-dimensional whereas the output of the detector is 1-dimensional.
Psychophysical Correspondence§
Color is not an intrinsic value of light; it is a result of human perception. Color arises from sensing light with different SPDs, as such different wavelengths of light are not colors.
There is no function that describes the perceived color, but it is helpful to consider only physical spectra that are distributed normally.
Under the normal distribution,
- the mean, $\mu$, can be interpreted as hue,
- variance, $\sigma^2$, as the saturation,
- and the area as brightness.
The Eye§
The human eye is essentially a biological camera,
- the lens refracts light,
- the iris is an annulus that acts similiarly to the diaphram,
- the pupil is the aperature whose size is controlled by the iris,
- the photoreceptor cells in the retina act as the sensor or film.
The optic disc is where the ganglion cell axons leave the eye, it is not covered by any photoreceptor cells which causes a blindspot in human vision. The blindspot is not noticable as the brain interpolates the information to fill in the gap.
The Retina§
The photoreceptor cells in the retina are the rods and cones.
Cones
- Less sensitive to intensity
- Gives color vision
- Three types:
- Long, medium, short
- Names correspond to the wavelength of light that is detected by the cone, i.e. long detects long wavelengths which appear more reddish.
- Some humans have the ability for tetrachromatism in which they are able to detect some ultraviolet light.
Rods
- Highly sensitive to intensity
- Gives greyscale vision in low light situations
As mentioned previously, the optic disc contains no rods or cones. The fovea centralis contains a high concentration of cones and relatively few rods.
Spectral Response of Human Cone Cells§
Each cone is essentially a different detector, each with its own spectral response curve. Functionally, the cone cells act as a reduction from $\infty$-dimensional wavelength space to a $3$-dimensional signal.
$$ \begin{align*} S &= \int r_S(\lambda)s(\lambda)d\lambda\\ M &= \int r_M(\lambda)s(\lambda)d\lambda\\ L &= \int r_L(\lambda)s(\lambda)d\lambda\\ \end{align*} $$
As a result, the brain does not receive information about specific wavelengths but the 3 response values from the different cones.
Metamers§
Metamers are two different spectra ($\infty$-dim) that have the same response ($3$-dim) to the cones; i.e. to a human these disinct spectra have the same color.
The existence of metamers are useful for color reproduction, as we need not reproduce the entire spectrum of a real-world scene.
Additive Color§
We can define a set of primary lights with a specific spectral distribution, $s_R(\lambda), s_G(\lambda), s_B(\lambda).$
The linear combination of these primary lights can be used to create a particular color:
$$ Rs_R(\lambda) + Gs_G(\lambda) + Bs_B(\lambda). $$
Now, a color can be represented by the triplet
$$ (R, G, B). $$
Color Replication Experiment§
Participants were given primaries that were each a singular wavelength and were given the task of adjusting the intensities of each primary to match a target color that was also a monochromatic light.
This gave rise to the CIE RGB color matching functions. In these color matching functions, an interesting phenomenon occurred in that some wavelengths required “negative” light in order to be reproduced.
In cases where the target color could not be attained by a linear combination of the primaries, some light was added onto the target until the color could be matched.
In the CIE XYZ color space, imaginary primary lights were created to avoid the negative coefficients.
Color Spaces§
Gamut
The gamut is the subset of colors that is able to be represented by a given display or color space.
RGB§
RGB represents red, green, and blue. This is the most common representation for devices such as monitors, however, it is nonstandard – RGB does not mean the same across all devices. Generally it is used as an additive system, i.e. each component adds more light and the combination of all three results in white.
The main drawbacks of RGB are that the channels are strongly correlated and it is nonperceptual.
HSV§
HSV stands for hue, saturation, and value. This color space is more intuitive and corresponds more to artistic characteristics of color.
YCbCr§
YCbCr is fast to compute and is good for compression; typically used in television.
The Y component represents the luminance, Cb and Cr represent the blue-difference and red-difference chroma.
CIELAB (L*a*b*)§
CIELAB aims for perceptual uniformity, where L* represents lightness, a* and b* are red-green and blue-yellow opponent pairs.
Sensors§
Problem: A sensor can only record a single scalar, but we need three to represent color.
Potential solutions:
- Capture three images at different times
- Issue: Moving objects will not be captured accurately
- Capture three images with three cameras
- Issue: Each image will have a different viewpoint
- RGB Mosaic
Bayer RGB Mosaic§
We can tile a grid with a pattern of R, G, and B sensors.
The grid contains more green sensors than red and blue; this is because we have three channels and a square grid. We choose green to fill in the extra spot as it is more important to human perception for luminance and green is “in the middle” of blue and red.
Demosaicing
In the mosaic, in areas where we capture one color we lose information about the other two. Demosaicing involves the interpolation of these missing values.
Methods of demosaicing
- take the value of the nearest neighbour
- linear interpolation between neighbours
- we can also use different, smoother kernels such as bicubic interpolation
Moire Aliasing§
Using mosaics we are subject to aliasing when sampling a scene, one typical occurrence are moire patterns.
Above is an extreme example of moire aliasing, given this checker board pattern that happens to have the white spots aligned with the green sensors. As the red and blue sensors are aligned with the black spots, they have no response. When interpolating in the demosaicing process, we end up with an all green result.
White Balancing§
In manual whitebalance, we choose an object known to be color-neutral and normalize all other colors against this object.
In automatic whitebalancing (AWB), two basic algorithms are:
- grey world, forcing the average color of the scene to a grey,
- white world, forcing the brightest object to white
In general, automatically computing the illuminant is a difficult task.