Lecture 11
Lecture 11
Spring 2020
Readings: Chapter 6
1 / 36
How to read: relaxed, with notes!
Table of Content
● Color Fundamentals
● Color Models
● Pseudocolor Image Processing
● Full-Color Image Processing
2 / 36
Color Fundamentals
3 / 36
Color Fundamentals
4 / 36
Color Fundamentals
5 / 36
Color Fundamentals
● There is a difference between primary colors of light and the primary colors
of pigments or colorants.
● In pigments, a primary color is the one that subtracts or absorbs a primary
color of light, and reflects or transmits the other two.
● The primary colors of pigments are magenta, cyan and yellow, and the
secondary colors are red, green and blue.
● Distinguishing characteristics of colors:
– Brightness: achromatic notion of intensity.
– Hue: dominant wavelength in a mixture of light waves, or the dominant
color perceived by an observer.
– Saturation: relative purity or the amount of white light mixed with the
hue.
● Hue and saturation combined are called chromaticity.
6 / 36
Color Fundamentals
X
x=
X +Y +Z
Y
y=
X +Y +Z
Z
z=
X +Y +Z
x+ y+ z=1
7 / 36
Color Models - RGB
8 / 36
Color Models – CMY and CMYK
● The secondary colors of light (cyan, magenta and yellow) are the primary
colors of pigments.
● For example, when a surface coated with cyan pigment is illuminated by
white light, no red light is reflected from the surface, since cyan subtracts red
light from the white light.
● Conversion from RGB to CMY is simple:
C 1 R
[ ] [] [ ]
M =1−G
Y 1 B
● Equal amounts of pigment primaries should produce black.
● In practice, since C, M and Y inks are not pure colors, this cannot be done.
Instead, a fourth color black, shown by K, is added.
9 / 36
Color Models – HSI
● RGB and CMY color models are not well-suited for color description for
practical human interpretation.
● Humans describe colors by hue, saturation and brightness.
● Distinguishing characteristics of colors:
– Brightness: achromatic notion of intensity.
– Hue: dominant wavelength in a mixture of light waves, or the dominant
color perceived by an observer.
– Saturation: relative purity or the amount of white light mixed with the
hue.
● Hue and saturation combined are called chromaticity.
● The HSI (hue, saturation, intensity) color model, decouples the intensity
component from the color-carrying information.
● The derivation is described in Section 6.2.
10 / 36
Color Models – HSI
3
{ 2
[( R−G )+(R−B)]
2
[(R−G) +( R−B)(G−B)]
1
2 }
S=1− [min( R , G , B )]
R +G +B
1
I = ( R+G +B)
3
11 / 36
Pseudocolor Image Processing
12 / 36
Pseudocolor Image Processing
13 / 36
Basics of Full-Color Image Processing
[ ][ ]
The color pixel can be shown as a vector: c (x , y)= c G ( x , y) = G( x , y )
cB( x , y ) B( x , y )
14 / 36
Color Models
15 / 36
Color Transformations
where n is the total number of component images, ri are the intensity values
of the input component images and si are the spatially corresponding
intensities in the output component images and Ti are the set of
transformations or color mappings.
● n is 3 for RGB, CMY and HSI, and is 4 for CMYK.
● T can be different for each component image.
● Even though any transformation can be performed in any color space, some
operations are better suited to specific models.
16 / 36
Color Transformations
● For example, let’s modify the intensity of an image with a constant value k in
the range [0,1].
● In the HSI color space, only we should modify the intensity component:
ri i=1,2,3
CMYK: si =
{k r i +(1−k ) i=4
17 / 36
Color Transformations
18 / 36
Color Complements
R out 1 R in
[ ] [][ ]
Gout = 1 − G in
B out 1 B in
Cyan
Com
plemen
ts
Red
Green Yellow
19 / 36
Color Complements
S out =S in
I out =1−I in
20 / 36
Color Slicing
W
si=
{ [
0.5 if |r j −a j|> ]
2 any 1≤ j≤n for i=1,2,. .. , n
ri otherwise
● If the colors of interest are shown by a sphere (hyper-sphere for n>3) of
radius R0, centered at color (a1, a2, …, an), the transformations are:
n
si=
{0.5 if
ri
∑ (r j−a j )2 > R 20
j=1
otherwise
for i=1,2,... , n
21 / 36
Color Slicing
22 / 36
Tonal and Color Corrections
23 / 36
Tonal and Color Corrections
24 / 36
Histogram Processing
25 / 36
Color Image Smoothing
26 / 36
Color Image Sharpening
● In RGB, the Laplacian operator can be computed for each of the image’s
color components.
● In HSI, only Laplacian of the intensity component is computed for image
sharpening.
●
27 / 36
Color Image Segmentation
28 / 36
Color Image Segmentation
29 / 36
Color Edge Detection
2 2 2
∂R ∂G ∂B
| || || |
{
T
∂R ∂G ∂B g xx =⃗
u . ⃗u=u u= + +
∂x ∂x ∂x
{ u=
v=
∂x
∂R
∂y
r+
r+
∂x
∂G
∂y
g+
g+
∂x
∂B
∂y
b
b yy
∂R
∂y
u . ⃗v =uT v=
g xy =⃗
∂G
∂y
2
∂B
g =⃗v . ⃗v =v v=| | +| | +| |
T
∂y
2 2
∂R ∂ R ∂G ∂G ∂ B ∂ B
+ +
∂x ∂ y ∂x ∂ y ∂x ∂ y
30 / 36
Color Edge Detection
● Based on the defined quantities, the direction of the maximum rate of change
of c(x,y) is given by:
1 2 g xy
θ ( x , y )= arctan
2 [
g xx −g yy ]
● The value of the rate of change in this direction 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
32 / 36
Noise in Color Images
● The characteristics of noise are usually similar in all of the image’s color
components, but this is not always the case.
● Fine grain noise is less visually noticeable in color images than in grayscale
images.
33 / 36
Noise in Color Images
34 / 36
What is Next?
35 / 36
Questions?
[email protected]
36 / 36