Documente Academic
Documente Profesional
Documente Cultură
Wavelets fundamentals
by Gleb V. Tcheslavski: gleb@ee.lamar.edu
http://ee.lamar.edu/gleb/dip/index.htm
Spring 2008 ELEN 4304/5365 DIP 1
Preliminaries
When looking at images,
we generally see connected
regions of similar texture
and intensity levels
combined to form
objects. Small or low-
contrast objects are better
viewed at high resolution.
If small and large objects
are present
present, it can be
advantageous to study them
at different resolutions.
From math viewpoint, images are 2D arrays of intensity values with
locally varying statistics that result from different features.
Spring 2008 ELEN 4304/5365 DIP 2
1
4/28/2008
Image pyramids
An image pyramid is a
collection of decreasing
resolution images arranged
in the shape of a pyramid.
The base of a pyramid is a
high resolution image
being processed; the apex contains a
low-resolution approximation.
While moving up, both size and
resolution decrease.
decrease
Image pyramids
The apex level 0 is of size 1x1. Most pyramids are truncated to P + 1
levels, where 1 ≤ P ≤ J. The total number of pixels in a P + 1 level
pyramid is
⎛ 1 1 1 ⎞ 4 2
N 2 ⎜1 + + 2 + ... + P ⎟≤ N
⎝ 4 4 4 ⎠ 3
On the diagram for constructing two image pyramids, the “level j-1
approximation output” provides the images needed to build an
approximation pyramid, while the “level j prediction residual output”
is used to build a complementary prediction residual pyramid. Unlike
approximation pyramids, prediction residual pyramids contain only
one reduced-resolution approximation of the input image (top of the
pyramid, level J-P). All other levels contain prediction residuals where
the level j prediction residual (J-P+1 ≤ j ≤ J) is defined as the
difference between level j approximation and its estimate.
Spring 2008 ELEN 4304/5365 DIP 4
2
4/28/2008
Image pyramids
An estimate of the level j approximation is computed based on the
level j-1 approximation.
Approximation and prediction residual pyramids can be computed
by iterations. The original image is placed in level J of the
approximation pyramid. The pyramids then are generated in P
iterations for the following steps for j = J, J-1,…, J-P+1:
1. Compute a reduced-resolution approximation of the level j image
by filtering and downsampling the filtered image by 2.
2. Estimate the level j input image from the reduced-resolution
approximation
i i by b upsampling
li byb 2 andd filtering.
fil i
3. Compute the difference between the output of step 2 and the
input of step 1. place this result in level j of the prediction
residual pyramid.
Spring 2008 ELEN 4304/5365 DIP 5
Image pyramids
For a 1D sequence f(n), the upsampled by 2 sequence is
⎧⎪ f ( n 2 ) if n is even
f 2↑ ( n ) = ⎨
⎪⎩0 otherwise
The downsampling by 2 is discarding every second sample and is
defined as
f 2↓ (n) = f (2n)
Spring 2008 ELEN 4304/5365 DIP 6
3
4/28/2008
Image pyramids
4-level approximation
pyramid: an original
512x512 image and its
approximations
i ti att
256x256, 128x128, and
64x64. A Gaussian
smoothing filter was used.
Prediction residual
pyramid. A bilinear
pyramid
interpolation filter was
used.
Spring 2008 ELEN 4304/5365 DIP 7
Subband coding
A 2-band subband
coding and decoding
system (analysis and
synthesis filter banks)
g
Magnitude frequency
q y
responses of the analysis
filter bank FIR filters
(half-band filters).
Spring 2008 ELEN 4304/5365 DIP 8
4
4/28/2008
Subband coding
Filter h0(n) is a low-pass (half-band) filter, whose output flp(n) is an
approximation of the input f(n); h1(n) is a high-pass (half-band)
filter, whose output fhp(n) is a high-frequency or detail part of the
input f(n). Synthesis filters glp(n) and ghp(n) combine two subband
signals to produce fˆ (n)
The goal of subband coding is to select filters such that fˆ (n) = f (n)
Which is called perfect reconstruction conditions that require
g 0 (n) = (−1) n h1 (n)
g1 ( n) = (−1) n +1 h0 (n)
or
g 0 (n) = (−1) n +1 h1 (n)
g1 ( n) = (−1) n h0 (n)
Spring 2008 ELEN 4304/5365 DIP 9
Subband coding
Filters must satisfy biorthogonality condition
hi (2n − k ), g j (k ) = δ (i − j )δ (n); i, j = {0,1}
inner product
5
4/28/2008
Subband coding
A 2D 4-band subband
coding (analysis)
filt bank.
filter b k
A 2D 4-band subband
decoding (synthesis)
filter bank will have a
reversed structure.
Spring 2008 ELEN 4304/5365 DIP 11
Subband coding
A 4-band A 4-band
approximation vertical
componentt d t il
detail
component
A 4-band A 4-band
horizontal diagonal
detail detail
component component
Spring 2008 ELEN 4304/5365 DIP 12
6
4/28/2008
Haar transform
The Haar transform can be expressed in the matrix form:
T = HFHT
NxN transformed image NxN image
NxN Haar transformation matrix
Spring 2008 ELEN 4304/5365 DIP 13
Haar transform
A 2x2 Haar transformation matrix is:
1 ⎡1 1 ⎤
H2 = ⎢ ⎥
2 ⎣1 −1⎦
And a 4x4 Haar transformation matrix is:
⎡ 1 1 1 1 ⎤
⎢ 1 1 −1 −1 ⎥⎥
1 ⎢
H4 =
4⎢ 2 − 2 0 0 ⎥
⎢ ⎥
⎢⎣ 0 0 2 − 2 ⎥⎦
Spring 2008 ELEN 4304/5365 DIP 14
7
4/28/2008
Haar transform
Discrete wavelet transform
(DWT) using Haar
functions: average (almost
uniform histogram) and
detail images having very
similar histograms.
Note: these figures are not
exactly a Haar transform!
DWT in 1D
details
A two-stage
analysis filter-bank:
filter bank:
Direct DWT
approximation
Bandwidths
Spring 2008 ELEN 4304/5365 DIP 16
8
4/28/2008
DWT in 1D
Spring 2008 ELEN 4304/5365 DIP 17
DWT in 2D HPF
HPF
LPF
DWT is a separable
transform… HPF
LPF
One stage 2D analysis bank
One-stage
LPF
Two-stage decomposition
Spring 2008 ELEN 4304/5365 DIP 18
9
4/28/2008
DWT in 2D
Two-scale 2D Three-scale
DWT 2D DWT
Spring 2008 ELEN 4304/5365 DIP 19
DWT in 2D
Zeroing the lowest scale
approximation component
of the DWT and
computing IDWT, it is
possible to enhance edges
of the image.
Spring 2008 ELEN 4304/5365 DIP 20
10
4/28/2008
DWT in 2D
A CT image uniformly corrupted
with white noise;
It is possible to attenuate (or
completely remove) noise by the
thresholding detail coefficients at
a selected level.
Wavelet packets
Detail channels can be
further split…
Structure and
bandwidths of a three-
scale full wavelet
packet analysis tree.
Spring 2008 ELEN 4304/5365 DIP 22
11
4/28/2008
Wavelet packets
Wavelet packets
An optimal wavelet
packet decomposition
Spring 2008 ELEN 4304/5365 DIP 24
12