Chapter 4 - Color in Image and Video
Chapter 4 - Color in Image and Video
E-Learing Center,
Fall 2008 (1387)
Chapter 4
Color in Image and Video
4.1 Color Science
4.2 Color Models in Images
4.3 Color Models in Video
Fundamentals of Multimedia, Chapter 4
(c) However, humans cannot detect all light, just contributions that fall in the
“visible wavelengths”.
(d) Short wavelengths produce a blue sensation, long wavelengths produce a red
one.
• Figure 4.1 shows the phenomenon that white light contains all
the colors of a rainbow.
• Fig. 4.2 shows the relative power in each wavelength interval for
typical outdoor light on a sunny day. This type of curve is called a
Spectral Power Distribution (SPD) or a spectrum.
Human Vision
• The eye works like a camera, with the lens focusing an image onto the retina
(upside-down and left-right reversed).
• The rods come into play when light levels are low and produce a image in
shades of gray (“all cats are gray at night!”).
• For higher light levels, the cones each produce a signal. Because of their
differing pigments, the three kinds of cones are most sensitive to red (R),
green (G), and blue (B) light.
• It seems likely that the brain makes use of differences R-G, G-B, and B-R, as
well as combining all of R, G, and B into a high-light-level achromatic
channel.
• The Blue receptor sensitivity is not shown to scale because it is much smaller
than the curves for Red or Green — Blue is a late addition, in evolution.
– Statistically, Blue is the favorite color of humans, regardless of nationality — perhaps for
this reason: Blue is a latecomer and thus is a bit surprising!
• Fig. 4.3 shows the overall sensitivity as a dashed line — this important curve
is called the luminous-efficiency function.
– It is usually denoted V (λ) and is formed as the sum of the response
curves for Red, Green, and Blue.
• The rod sensitivity curve looks like the luminous-efficiency function V (λ)
but is shifted to the red end of the spectrum.
Fig. 4.3: R,G, and B cones, and Luminous Efficiency curve V(λ).
R = ∫E(λ) qR(λ) dλ
G = ∫E(λ) qG(λ) dλ
Image Formation
• Surfaces reflect different amounts of light at different
wavelengths, and dark surfaces reflect less energy than light
surfaces.
• Fig. 4.4 shows the surface spectral reflectance from (1) orange
sneakers and (2) faded blue jeans. The reflectance function is
denoted S(λ).
Camera Systems
• Camera systems are made in a similar fashion; a studio
quality camera has three signals produced at each pixel
location (corresponding to a retinal position).
Gamma Correction
• The light emitted is in fact roughly proportional to the voltage raised
to a power; this power is called gamma, with symbol γ.
(a) Thus, if the file value in the red channel is R, the screen emits light
proportional to Rγ, with SPD equal to that of the red phosphor paint
on the screen that is the target of the red channel electron gun. The
value of gamma is around 2.2.
R → R′ = R1/γ ⇒ (R′)γ → R
(4.4)
Color-Matching Functions
• Even without knowing the eye-sensitivity curves of Fig.4.3, a
technique evolved in psychology for matching a combination of
basic R, G, and B lights to a given shade.
• The basic situation is shown in Fig.4.8. A device for carrying out such
an experiment is called a colorimeter.
(a) The resulting curves are shown in Fig. 4.10; these are
usually referred to as the color-matching functions.
(c) The matrix is chosen such that the middle standard color-
matching function y ( ) exactly equals the luminous-
efficiency curve V(λ) shown in Fig. 4.3.
24 Multimedia Systems ([email protected])
Fundamentals of Multimedia, Chapter 4
International Commission on Illumination
(usually known as the CIE for its French name
Commission internationale de l'éclairage)
X E ( ) x ( ) d
Y E ( ) y ( ) d
Z E ( ) z ( ) d (4.6)
x = X/(X +Y +Z)
y = Y/(X +Y +Z)
z = Z/(X +Y +Z) (4.7)
• This effectively means that one value out of the set (x, y, z) is
redundant since we have
x y z X Y Z 1 (4.8)
X Y Z
so that
z=1−x−y (4.9)
yW xW yb xb yg xg yr xr System
Out-of-Gamut colors
• For any (x, y) pair we wish to find that RGB triple
giving the specified (x, y, z): We form the z values
for the phosphors, via z = 1 − x − y and solve for
RGB from the phosphor chromaticities.
T = M D (4.15)
• Nevertheless this is not often done as stated. Instead, the equation for
the Y value is used as is, but applied to nonlinear signals.
(a) The only concession to accuracy is to give the new name Y ′ to this new
Y value created from R′, G′, B′.
Y ′ = 0.299·R′+0.587·G′+0.114·B′ (4.20)
• CIELAB:
2 2 b
chroma c (a ) (b ) , hue angle h arctan
a
• Schemes include:
a) CMY — Cyan (C), Magenta (M) and Yellow (Y) color model;
e) HCI — C=Chroma;
f) HVC — V=Value;
g) HSD — D=Darkness.
1. We expect to be able to use 8 bits per color channel for color that is accurate
enough.
2. However, in fact we have to use about 12 bits per channel to avoid an aliasing
effect in dark image areas — contour bands that result from gamma correction.
2. These subtractive color primaries are Cyan (C), Magenta (M) and
Yellow (Y) inks.
C 1 R
M 1 G
(4.24)
Y 1 B
K min{C , M , Y } (4.26)
C C K
M M K
Y Y K
Fig. 4.16: Additive and subtractive color. (a): RGB is used to specify
additive color. (b): CMY is used to specify subtractive color
Printer Gamuts
• Actual transmission curves overlap for the C,
M, Y inks. This leads to “crosstalk” between
the color channels and difficulties in predicting
colors achievable in printing.
(a) Largely derive from older analog methods of coding color for TV. Luminance
is separated from color information.
(b) For example, a matrix transform method similar to Eq. (4.9) called YIQ is
used to transmit TV signals in North America and Japan.
(c) This coding also makes its way into VHS video tape coding in these countries
since video tape technologies also use YIQ.
(d) In Europe, video tape uses the PAL or SECAM codings, which are based on
TV that uses a matrix transform called YUV.
(e) Finally, digital video mostly uses a matrix transform called YCbCr that is
closely related to YUV
(b) Chrominance refers to the difference between a color and a reference white at the
same luminance. → use color differences U, V:
U = B′ − Y′ , V = R′ − Y′ (4.27)
(d) In the actual implementation U and V are rescaled to have a more convenient maximum and
minimum.
(e) For dealing with composite video, it turns out to be convenient to contain the composite signal
magnitude Y U 2 within
V 2 the range −1/3 to +4/3. So U and V are rescaled:
(f) Zero is not the minimum value for U, V . U is approximately from blue (U > 0) to yellow (U < 0) in
the RGB cube; V is approximately from red (V > 0) to cyan (V < 0).
(g) Fig. 4.18 shows the decomposition of a color image into its Y′, U, V components. Since both U and V
go negative, in fact the images displayed are shifted and rescaled.
(d) Fig. 4.19 shows the decomposition of the same color image as above, into YIQ components.
(a) YUV is changed by scaling such that Cb is U, but with a coefficient of 0.5 multiplying B′. In some software
systems, Cb and Cr are also shifted such that values are between 0 and 1.
Cb = ((B′ − Y′)/1.772)+0.5