Lect07.ppt digital image processing for computer and eng student
1.
CS589-04 Digital ImageProcessing
CS589-04 Digital Image Processing
Lecture 6. Color Image
Lecture 6. Color Image
Processing
Processing
Spring 2008
Spring 2008
New Mexico Tech
New Mexico Tech
11/07/25 4
Color Fundamentals
ColorFundamentals
► 6 to 7 million cones in the human eye can be divided
into three principal sensing categories, corresponding
roughly to red, green, and blue.
65%: red 33%: green 2%: blue (blue cones are the
most sensitive)
11/07/25 7
Color Fundamentals
ColorFundamentals
► The characteristics generally used to distinguish one
color from another are brightness, hue, and saturation
brightness: the achromatic notion of intensity.
hue: dominant wavelength in a mixture of light waves,
represents dominant color as perceived by an observer.
saturation: relative purity or the amount of white light
mixed with its hue.
8.
11/07/25 8
Color Fundamentals
ColorFundamentals
► 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
9.
11/07/25 9
CIE ChromaticityDiagram
CIE Chromaticity Diagram
It shows color
composition
as a function
of x (red) and
y (green)
11/07/25 15
The CMYand CMYK Color Models
The CMY and CMYK Color Models
1
1
1
C R
M G
Y 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.
To produce true black, the predominant color in printing,
the fourth color, black, is added, giving rise to the CMYK
color model.
11/07/25 17
HIS ColorModel
HIS Color Model
brightness: the achromatic notion of intensity.
hue: dominant wavelength in a mixture of light waves, represents dominant
color as perceived by an observer.
saturation: relative purity or the amount of white light mixed with its hue.
11/07/25 21
Converting Colorsfrom RGB to HSI
Converting Colors from RGB to HSI
► Given an image in RGB color format, the H component
of each RGB pixel is obtained using the equation
if B G
360 if B>G
H
1
1/2
2
1
( ) ( )
2
cos
( )( )
R G R B
R G R B G B
22.
11/07/25 22
Converting Colorsfrom RGB to HSI
Converting Colors from RGB to HSI
► Given an image in RGB color format, the saturation
component is given by
3
1 min( , , )
( )
S R G B
R G B
23.
11/07/25 23
Converting Colorsfrom RGB to HSI
Converting Colors from RGB to HSI
► Given an image in RGB color format, the intensity
component is given by
1
3
I R G B
24.
11/07/25 24
Converting Colorsfrom HSI to RGB
Converting Colors from HSI to RGB
► RG sector
(1 )
cos
1
cos(60 )
and
3 ( )
B I S
S H
R I
H
G I R B
(0 120 )
H
25.
11/07/25 25
Converting Colorsfrom HSI to RGB
Converting Colors from HSI to RGB
► RG sector
120
(1 )
cos
1
cos(60 )
and
3 ( )
H H
R I S
S H
G I
H
B I R G
(120 240 )
H
26.
11/07/25 26
Converting Colorsfrom HSI to RGB
Converting Colors from HSI to RGB
► RG sector
240
(1 )
cos
1
cos(60 )
and
3 ( )
H H
G I S
S H
B I
H
R I G B
(240 360 )
H
11/07/25 30
Pseudocolor ImageProcessing
Pseudocolor Image Processing
► The process of assigning colors to gray values based on
a specified criterion.
► Intensity Slicing
( , ) if ( , )
k k
f x y c f x y V
11/07/25 37
The imagesare obtained
from an airport X-ray
scanning system.
The left contains ordinary
articles and the right
contains the same articles
as well as a block of
simulated plastic
explosives.
11/07/25 41
Pseudocolor bycombining
several of the sensor
images from the Galileo
spacecraft, some of which
are in spectral regions not
visible to the eye.
Bright red depicts
materials newly ejected
from an active volcano on
Io, and the surrounding
yellow materials are older
sulfur deposits.
42.
11/07/25 42
Basics ofFull-Color Image Processing
Basics of Full-Color Image Processing
Let represent an arbitrary vector in RGB color space:
At coordinates ( , ),
( , ) ( , )
( , ) ( , ) ( , )
( , ) ( , )
R
G
B
R
G
B
c
c R
c c G
c B
x y
c x y R x y
c x y c x y G x y
c x y B x y
11/07/25 49
Color slicing
Colorslicing
► Highlighting a specific range of colors in an image
1 2
If the colors of interest are enclosed by a cube of width W
and centered at a protypical color with components
( , ,..., ), the necessary set of transformations is
0.5 if
n
i
a a a
s any 1
| | / 2
otherwise
j j j n
i
r a W
r
50.
11/07/25 50
Color slicing
Colorslicing
0
2 2
0
1
If a sphere is used to specify the colors of interest,
R is the radius of the enclosing of its center.
The transformations is
0.5 if
n
j j
j
i
i
r a R
s
r
otherwise
11/07/25 55
Color ImageSmoothing
Color Image Smoothing
( , )
Let denote the set of coordinates defining a neighborhood
centered at ( , ) in an RGB color image. The average of the
RGB component vectors in this neighborhood is
1
( , ) ( , )
xy
xy
s t S
S
x y
c x y c s t
K
( , )
( , )
( , )
1
( , )
1
( , )
1
( , )
xy
xy
xy
s t S
s t S
s t S
R s t
K
G s t
K
B s t
K
11/07/25 59
Color ImageSharpening
Color Image Sharpening
2
2 2
2
The Laplacian of vector c is
( , )
( , ) ( , )
( , )
R x y
c x y G x y
B x y
11/07/25 62
Segmentation inRGB Vector Space
Segmentation in RGB Vector Space
1/2
1/2
2 2 2
Let the average color of interest is denoted by the
RGB vector . Let denote an arbitrary point in
RGB space.
( , ) ( ) ( )
( ) ( ) ( )
T
R R G G B B
a z
D z a z a z a z a
z a z a z a
11/07/25 64
Color EdgeDetection (1)
Color Edge Detection (1)
Let r, g, and b be unit vectors along the R, G, and B
axis of RGB color space, and define vectors
u r g b
and
v r g b
R G B
x x x
R G B
y y y
65.
11/07/25 65
Color EdgeDetection (2)
Color Edge Detection (2)
2 2 2
2 2 2
u u=
v v=
and
u v=
xx
yy
xy
R G B
g
x x x
R G B
g
y y y
R R G G B B
g
x y x y x y
66.
11/07/25 66
Color EdgeDetection (3)
Color Edge Detection (3)
1
The direction of maximum rate of change of c( , ) is given by
the angle
2
1
( , ) tan
2
The value of the rate of change at ( , ) in the direction of ( , ),
is given by
1
F ( , )=
2
xy
xx yy
x
x y
g
x y
g g
x y x y
x y g
1/2
cos2 ( , ) 2 sin 2 ( , )
x yy xx yy xy
g g g x y g x y