Part 7
Part 7
Part 7
Color Image Processing
It is only after years of preparation that the young artist should touch
color—not color used descriptively, that is, but as a means of
personal expression. ~Henri Matisse
Outline
► White light
Newton 1665
3
Slide credit: B. Freeman, A. Torralba, K. Grauman
Color Fundamentals
4
Color Fundamentals
5
Renk Temelleri
Three basic parameters are used to express the
property of colored light:
1. Radiance: It is the total amount of energy
emitted from the light source and is measured in
Watt (W).
2. Luminance: It is the total amount of energy that
the observer perceives from the light source and
is measured in Lumen (lm).
3. Brightness: It is a subjective descriptive
parameter that is practically impossible to
measure. It indicates colorlessness of intensity.
6
Color Fundamentals
8
9
Color Fundamentals
► The characteristics generally used to distinguish
one color from another are brightness, hue, and
saturation
► Tristimulus
Red, green, and blue are denoted X, Y, and Z,
respectively. A color is defined by its trichromatic
coefficients, defined as
X
x=
X +Y + Z
Y
y=
X +Y + Z
Z
z=
X +Y + Z
11
CIE Chromaticity Diagram
It shows color
composition as
a function of x
(red) and y
(green)
12
RGB Color Model
13
RGB Color Model
Pixel depth
14
The CMY and CMYK Color Models
C 1 R
M = 1 − G
Y 1 B
Equal amounts of the pigment primaries, cyan, magenta, and yellow
should produce black. In practice, combining these colors for
printing produces a muddy-looking black.
15
CMY vs. CMYK
16
http://en.wikipedia.org/wiki/CMYK
HIS Color Model
17
HIS Color Model
18
Converting Colors from RGB to HSI
1
−1
( R − G ) + ( R − B )
= cos 2
1/2
( R − G ) + ( R − B )(G − B )
2
19
Converting Colors from RGB to HSI
3
S = 1− min( R, G, B)
( R + G + B)
Python code:
hsvImage = cv2.cvtColor(image, cv2.COLOR_RGB2HSV)
22
Converting Colors from HSI to RGB
► RG sector (0 H 120 )
B = I (1 − S )
S cos H
R = I 1 +
cos(60 − H )
and
G = 3I − ( R + B )
Note: All color values
are normalized to
the range [0-1].
23
Converting Colors from HSI to RGB
H = H − 120
R = I (1 − S )
S cos H
G = I 1 +
cos(60 − H )
and
B = 3I − ( R + G ) Note: All color values
are normalized to
the range [0-1].
24
Converting Colors from HSI to RGB
H = H − 240
G = I (1 − S )
S cos H
B = I 1 +
cos(60 − H )
and Note: All color values
are normalized to
R = 3I − (G + B ) the range [0-1].
Python Code:
rgbImage = cv2.cvtColor(image, cv2.COLOR_HSV2RGB) 25
26
27
Pseudocolor Image Processing
► Intensity Slicing
f ( x, y ) = ck if f ( x, y ) Vk
28
29
30
31
32
33
34
Pseudocolor by combining
several of the sensor images
from the Galileo spacecraft,
some of which are in spectral
regions not visible to the eye.
35
Basics of Full-Color Image Processing
36
Basics of Full-Color Image Processing
37
References