Chapter 06-Colour Image Processing
Chapter 06-Colour Image Processing
Christophoros Nikou
cnikou@cs.uoi.gr
x + y + z =1
For any visible wavelength the tristimulus values
needed to produce that wavelength are obtained
by curves compiled by extensive experimentation.
We will return to that point at the last part of the
lecture.
C. Nikou – Digital Image Processing (E12)
16 CIE Chromaticity Diagram
Specifying colors systematically can be
achieved using the CIE chromacity diagram.
On this diagram the x-axis represents the
proportion of red and the y-axis represents the
proportion of green used to produce a specific
color .
The proportion of blue used in a color is
calculated as:
z = 1 – (x + y)
C. Nikou – Digital Image Processing (E12)
17 CIE Chromacity Diagram (cont…)
Point marked “Green”:
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
printing gamut is
irregular because
printing is a
combination of additive
and subtractive color
mixing.
This is a more difficult
process to control than
that of displaying
colors.
C. Nikou – Digital Image Processing (E12)
26 Color Models
From the previous discussion it should be
obvious that there are different ways to model
color.
We will consider two very popular models
used in color image processing:
– RGB (Red Green Blue)
– HSI (Hue Saturation Intensity)
colors.
C. Nikou – Digital Image Processing (E12)
30
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
RGB (cont…)
(percentage of white
missing from the color)
increases as a function of
distance from the
intensity axis.
Conclusion:
The HIS values can be
obtained from the RGB
values. We have to work
the gometric formulas.
C. Nikou – Digital Image Processing (E12)
38 The HSI Color Model
If we look straight down at the RGB cube as it was
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
arranged previously
we would see a hexagonal
shape with each primary
color separated by 120°
and secondary colors
at 60°from the primaries.
The HSI model is
composed of a vertical
intensity axis and the locus of color points that lie on
planes perpendicular to that axis.
C. Nikou – Digital Image Processing (E12)
39 The HSI Color Model (cont…)
To the right we see a hexagonal
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
3
S = 1− [min(R,G,B)] I= 1
(R + G + B)
(R + G + B) 3
⎡ S cos ( H − 240 ) ⎤
R = 3I − ( G + B ) , G = I (1 − S ) , B = I ⎢1 + ⎥
⎣ cos ( H − 180 ) ⎦
Manipulations
RGB
Hue
Image
Saturation Intensity
Hue
Saturation
Intensity RGB
Image
Assining the yellow color to intensity 255 and the blue color to the
rest of the intensities may help a human inspector to rapidly evaluate
a crack in an image of a weld.
(a)
(b)
R G B Color image
∂R ∂G ∂B
2 2 2
g xx = uiu = u iu =
T
+ +
∂x ∂x ∂x
2 2 2
∂R ∂G ∂B
g yy = v i v = v i v =
T
+ +
∂y ∂y ∂y
∂R ∂R ∂G ∂G ∂B ∂B
g xy = ui v = u i v =
T
+ +
∂x ∂y ∂x ∂y ∂x ∂y
C. Nikou – Digital Image Processing (E12)
69 Color Image Gradient (cont…)
The direction of maximum rate of change of
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
1 ⎛ 2 g xy ⎞
θ ( x, y ) = tan ⎜
−1
⎟⎟
2 ⎜g −g
⎝ xx yy ⎠
and the value of that rate of change is:
1
⎧1 ⎫
Fθ ( x, y ) = ⎨ ⎡⎣( g xx + g yy ) + ( g xx − g yy ) cos ( 2θ ( x, y ) ) + 2 g xy sin ( 2θ ( x, y ) ) ⎤⎦ ⎬
2
⎩2 ⎭
distributions, that is
C1(λ) ≠ C2(λ),
λ
∫ Pk (λ )d λ = 1, k = 1, 2,3
min ( k )
proportions βk , k=1,2,3:
⎛ 3
⎞
ai ( C ) = ai ⎜ ∑ β k Pk (λ ) ⎟ ⇔
⎝ k =1 ⎠
λmax ( i ) λmax ( i ) 3
∫ Si (λ )C (λ )d λ = ∫ Si (λ )∑ βκ Pk (λ ) d λ , ⇔
λmin ( i ) λmin ( i )
k =1
λmax ( i ) 3 λmax ( i )
∫ Si (λ )C (λ )d λ = ∑ βκ ∫ Si (λ ) Pk (λ )d λ , ⇔
λmin ( i )
k =1 λmin ( i )
k=1,2,3 as unknowns:
λmax ( i ) 3 λmax ( i )
∫ Si (λ )C (λ )d λ = ∑ βκ ∫ Si (λ ) Pk (λ )d λ , ⇔
λmin ( i )
k =1 λ min ( i )
3
ai ( C ) = ∑ β k ⎡⎣ ai ( Pk (λ ) ) ⎤⎦ , i = 1, 2,3.
k =1
The negative values for a part of the red curve clearly show
that we cannot reproduce every color with the RGB primaries
(as we have also explained by the chromaticity diagram).