Module 4
Module 4
1
Preview
Motive
- Color is a powerful descriptor that often simplifies
object identification and extraction from a scene.
- Human can discern thousands of color shades and
intensities, compared to about only two dozen
shades of gray.
2
Preview
Color image processing is divide into two major area:
Full-Color Processing
Pseudo-Color Processing
3
Color Fundamentals
4
Color Fundamentals (con’t)
5
Color Fundamentals (con’t)
6
Physical Background
7
Achromatic vs Chromatic Light
8
Quantities for description of Chromatic Source of
Light
• Radiance
• Luminance
• Brightness
9
Radiance
• It is measured in Watts
10
Luminance
11
Brightness
• It is a subjective measure
12
Human Perception
• Cones are the sensors in the eye responsible for color vision.
13
Human Perception
14
Absorption of Light by red, green and blue
cones in Human Eye
Standard wavelength values for the
primary colors
• Magenta (Red+Blue)
• Cyan (Green+Blue)
• Yellow (Red+Green)
16
Primary Color of Light vs Primary Color of Pigments
17
Color Fundamentals (con’t)
18
19
Color Fundamentals (con’t)
20
Hue:
It is a Attribute
It is having dominant wavelength
Represents dominant color as perceived by an
observer.
red,
orange
yellow it means we are refering to its hue.
21
Saturation: Relative purity or the amount of white light
mixed with a hue.
22
Brightness
• It is a subjective descriptor
• It Not possible to measure
• It embodies the achromatic notion of
intensity and
• It is one of the key factors in describing
color sensation
23
Color Fundamentals (con’t)
Tri-chromatic coefficient:
X Y Z
x y z
X Y Z X Y Z X Y Z
x y z 1
24
Chromaticity Diagram
z=1-x-y
Green Point =
62% green,
25% red,
13% blue.
25
Chromaticity Diagram
Chromaticity Diagram
26
Chromaticity Diagram
Color Gamut
produced by RGB
monitors
Color Gamut
produced by high
quality color printing
device
28
Color Models
• Color Models
RGB (Red, Green, Blue)
CMY (Cyan, Magenta, Yellow)
CMYK (CMY, black) model for color printing.
HSI (Hue, Saturation, Intensity)
YIQ (Luminance,In phase, Quadrature)
YUV (Y' stands for the luma component (the brightness)
and U and V are the chrominance (color) components )
29
RGB Model
30
RGB Model
• In this model, the primary colors are red, green, and blue. It is
an additive model, in which colors are produced by adding
components, with white having all colors present and black
being the absence of any color.
31
• In RGB color model, a color image is represented
as 3 separate sub images.
• Each of RGB sub image is monochromatic. The sub
image are combined on phosphor screen to
produce a composite color image.
• The no. of bits used to represent each pixel in RGB
space is called as the pixel depth.
32
The RGB Color Models
(con’t)
34
The RGB Color Models (con’t)
Safe RGB Colors (Safe Web colors)
35
The RGB Color Models (con’t)
36
The CMY and CMYK Color Models
37
CMY and CMYK Color Model
• Cyan, magenta, and yellow are the secondary colors with respect to the
primary colors of red, green, and blue. However, in this subtractive model,
they are the primary colors and red, green, and blue, are the secondaries.
In this model, colors are formed by subtraction, where adding different
pigments causes various colors not to be reflected and thus not to be seen.
Here, white is the absence of colors, and black is the sum of all of them.
This is generally the model used for printing.
• Most devices that deposit color pigments on paper (such as Color Printers
and Copiers) requires CMY data input or perform RGB to CMY conversion
internally
C 1.00 R
M = 1.00
- G
Y 1.00 B
38
CMY and CMYK Color Model
39
CMY Color Model
40
CMY Color Model
41
HSI Color Model
• Intensity
• Distinguishes the gray levels.
42
HSI Color Model
43
The HSI Color Models
44
The HSI Color Models
45
The HSI Color Models
46
The HSI Color Models
Converting colors from RGB to HSI
1
I ( R G B)
3
47
The HSI Color Models
B I (1 S )
G 3I ( R B )
48
The HSI Color Models
H H 120
R I (1 S )
B 3I ( R G )
49
The HSI Color Models
H H 240
G I (1 S )
R 3I (G B)
50
The HSI Color Models
51
The HSI Color Models
RGB H H S
S I I RGB
52
Pseudocolor Image Processing
Pseudo color (also called false color) image processing consists of assigning
colors to gray values based on a specified criterion.
The principal use of pseudo color is for human visualization and interpretation
of gray-scale events in an image or sequence of images.
53
Contd…
54
Pseudo-Coloring using LUT
55
Intensity Slicing
56
Intensity Slicing (con’t)
57
Gray Level to Color Transformations
The three results can then serve as the red, green, and
blue components of a color image
59
Gray Level to Color Transformations
60
Gray Level to Color Transformations
61
Gray Level to Color Transformations
62
Gray Level to Color Transformations
63
Basics of Full Color Image Processing
64
Basic of Full Color Image Processing
Let c represent an arbitrary vector in RGB color space
65
COLOR IMAGE PROCESSING
PRIVIOUS QUESTIONS PAPER QUESTIONS
66
MODULE 4
RBT Level:- L1, L2, L3
• Color Image Processing: Color Fundamentals, Color Models,
Pseudocolor Image Processing.
• Wavelets: Background, Multiresolution Expansions.
• Morphological Image Processing: Preliminaries, Erosion and
Dilation, Opening and Closing, The Hit-or-Miss Transforms,
Some Basic Morphological Algorithms.
67
Digital Image Processing
68
Contents
• Image pyramids
• Subband coding
• The Haar transform
• Multiresolution analysis
• Series expansion
• Scaling functions
• Wavelet functions
• Wavelet series
• Discrete wavelet transform (DWT)
• Fast wavelet transform (FWT)
• Wavelet packets
69
Introduction
Unlike the Fourier transform, which decomposes a
signal to a sum of sinusoids, the wavelet transform
decomposes a signal (image) to small waves of varying
frequency and limited duration.
The advantage is that we also know when (where) the
frequency appear.
Many applications in image compression, transmission,
and analysis.
We will examine wavelets from a multiresolution point
of view and begin with an overview of imaging
techniques involved in multiresolution theory.
70
Introduction (cont...)
Small objects are viewed
at high resolutions.
71
Image Pyramids
Originally devised for machine vision and image
compression.
It is a collection of images at decreasing resolution levels.
Base level is of size 2Jx2J or NxN.
Level j is of size 2jx2j.
72
Image Pyramids (cont…)
Approximation pyramid:
At each reduced resolution level we have a filtered and
downsampled image.
73
Image Pyramids (cont…)
Prediction pyramid:
A prediction of each high resolution level is obtained by
upsampling (inserting zeros) the previous low resolution
level (prediction pyramid) and interpolation (filtering).
f (n / 2) if n is even
f 2 (n)
0 otherwise
74
Image Pyramids (cont…)
Prediction residual pyramid:
At each resolution level, the prediction error is retained along with
the lowest resolution level image.
The original image may be reconstructed from this information.
75
Image Pyramids (cont…)
Approximation pyramid
76
Subband Coding
An image is decomposed to a set of
bandlimited components (subbands).
77
Subband Coding (cont…)
78
Subband Coding (cont…)
A two-band subband coding
Approximation filter
(low pass)
79
Subband Coding (cont…)
The goal of subband coding
is to select the analysis and
synthesis filters in order to
have perfect reconstruction
of the signal.
where the subscript means that the size of the filter should be
82
even.
Subband Coding (cont…)
gi (n) (1) n g 0 ( K even 1 n)
hi (n) gi ( K even 1 n), i {0,1}
83
Subband Coding (cont…)
Approximation
subband
Vertical subband
Horizontal
subband
Diagonal
subband
84
Subband Coding (cont…)
The subbbands may be subsequently split into
smaller subbands.
Image synthesis is obtained by reversing the
procedure.
85
Subband Coding (cont…)
The wavy lines are due to aliasing of the barely discernable
window screen. Despite the aliasing, the image may be
perfectly reconstructed.
86
The Haar Transform
It is due to Alfred Haar [1910].
Its basis functions are the simplest known
orthonormal wavelets.
The Haar transform is both separable and
symmetric:
T=HFH,
F is a NxN image and H is the NxN
transformation matrix and T is the NxN
transformed image.
Matrix H contains the Haar basis functions.
87
The Haar Transform (cont…)
The Haar basis functions hk(z) are defined for in
0≤ z ≤1, for k=0,1,…, N-1, where N=2n.
To generate H:
• we define the integer k=2p+q-1, with 0≤ p ≤N-1.
• if p=0, then q=0 or q=1.
• if p≠0, 1≤q ≤2p
2p/2 (q 1) / 2 p z (q 0.5) / 2 p
1 p/2
hk ( z ) hpq ( z ) , 2 (q 0.5) / 2 p z q / 2 p
N
0 otherwise, z [0,1]
1 1 1
H2
2 1 1
97
98
Contd..
7.2.1 Series Expansions
A signal f(x) can be expressed as a linear combination of expansion
functions:
f ( x) k k ( x)
A function can be expressedkas
99
Contd..
• Series Expansions
Orthonormal basis k ( x) k ( x)
0 jk
j ( x), k ( x)
1 jk
biorthogonal
j ( x), k ( x) 0 jk
0 jk
j ( x), k ( x)
1 jk
100
• A signal f(x) can be expressed as a linear combination of
expansion functions: f ( x) ( x)
k
k k
101
7.2.2 Scaling functions
• Scaling functions
Integer translations and binary scaling's of a scaling function ( x)
j ,k ( x) 2 (2 x k )
j/2 j
f ( x) k j0 ,k ( x)
k
102
103
0 0 x 1
( x)
1 otherwise
1
0,k ( x) 1,2 k ( x)
2
1
1,2 k 1 ( x)
2
f ( x) 0.51,0 ( x)
1,1 ( x) 0.251,4 ( x)
104
Multiresolution Expansions
( x)
• Scaling functions
Dilation equation for scaling function
( x) h (n) 2 (2 x n)
n h (0) h (1) 1 2
h (n) are called scaling function coefficients
Example: Haar wavelet,
1 1 2 (2 x 1)
( x) 2 (2 x )
2 2
105
106
Multiresolution Expansions
• Wavelet functions ( x) h (n) 2 (2 x n)
n
1 0 x 0.5
( x) 1 0.5 x 1
0 elsewhere
109
Wavelet Transform: 1-D
f ( x) c j0 j0 ,k ( x) d j (k ) j ,k ( x)
• Wavelet series expansion
k j j0 k
wherec (k ) f ( x), ( x)
j0 j0 , k f ( x) j0 , k ( x)dx
110
1
y ( x) 0,0 ( x)
3
1
0,0 ( x)
4
2
1,0 ( x)
32
3 2
1,1 ( x)
32
......
111
Wavelet Transform: 1-D
1
( x)
• Discrete Waveletf Transform
M k
W ( j0 , k ) j0 ,k ( x)
1
M j j0 k
W ( j , k ) j ,k ( x)
1
where
Approximation
coefficients W ( j0 , k )
M
f ( x)
x
j0 , k ( x)
1
f ( x)
Detail coefficients
W ( j , k ) j ,k ( x)
M x
112
Fast Wavelet Transform: Decomposition
W ( j, k ) h (n) W ( j 1, n) n 2 k ,k 0
W ( j, k ) h (n) W ( j 1, n) n 2 k , k 0
113
Fast Wavelet Transform: Decomposition
114
Example: Haar Wavelet
1 2 n0
1/ 2 n 0,1
h (n) h (n) 1 2 n 1
0 otherwise 0 otherwise
115
Fast Wavelet Transform:
Reconstruction
W ( j 1, k ) h (k ) W ( j, k ) h (k ) W ( j, k )
up up
k 0
116
Fast Wavelet Transform:
Reconstruction
117
Fast Wavelet Transform:
Reconstruction
118
Wavelet Transform vs. Fourier
Transform
119
Wavelet Transform: 2-D
Scaling function:
( x, y ) ( x) ( y )
Wavelet functions:
H ( x, y ) ( x) ( y ) Horizontal direction
120
2-D Wavelet Transform:
Decomposition
121
2-D Wavelet Transform:
Reconstruction
122
123
124
Fig. 7.24 (g)
125
Image Processing by Wavelet Transform
• Three Steps:
Decompose the image into wavelet domain
Alter the wavelet coefficients, according to your applications
such as denoising, compression, edge enhancement, etc.
Reconstruct the image with the altered wavelet coefficients.
126
127
Wavelet Transform based Denoising
• Three Steps:
Decompose the image into several scales.
For each wavelet coefficient y:
y y t
y
Hard thresholding: 0 y t
sign( y ) ( y t ) y t
y
Soft thresholding: 0 y t
130
All Images taken from Gonzalez & Woods, Digital Image Processing (2002)
131