07-1 - wavelets fundamentals
TRANSCRIPT
4/28/2008
1
Wavelets fundamentals
Spring 2008 ELEN 4304/5365 DIP 1
by Gleb V. Tcheslavski: [email protected]
http://ee.lamar.edu/gleb/dip/index.htm
Preliminaries When looking at images, we generally see connected regions of similar texture and intensity levels combined to formobjects. Small or low-contrast objects are better viewed at high resolution. If small and large objects are present it can be
Spring 2008 ELEN 4304/5365 DIP 2
are 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.
4/28/2008
2
Image pyramidsAn 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 imagebeing processed; the apex contains a low-resolution approximation. While moving up, both size and resolution decrease
Spring 2008 ELEN 4304/5365 DIP 3
resolution decrease.
Base level J is of size
where
2 2J J N N⋅ = ⋅
2logJ N=
Image pyramidsThe 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 22
1 1 1 41 ...4 4 4 3PN N⎛ ⎞+ + + + ≤⎜ ⎟
⎝ ⎠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
Spring 2008 ELEN 4304/5365 DIP 4
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.
4/28/2008
3
Image pyramidsAn 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 Piterations 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
i i b li b 2 d fil i
Spring 2008 ELEN 4304/5365 DIP 5
approximation by upsampling by 2 and filtering.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.
Image pyramids
For a 1D sequence f(n), the upsampled by 2 sequence is
( )2f n if n is even ⎧⎪ ( )2
2( )
0f n if n is even
f notherwise↑
⎧⎪= ⎨ ⎪⎩
The downsampling by 2 is discarding every second sample and is defined as
2 ( ) (2 )f n f n↓ =
Spring 2008 ELEN 4304/5365 DIP 6
Both operations are usually followed by approximation and interpolation filters.
4/28/2008
4
Image pyramids4-level approximation pyramid: an original 512x512 image and its
i ti tapproximations at 256x256, 128x128, and 64x64. A Gaussian smoothing filter was used.
Prediction residual pyramid A bilinear
Spring 2008 ELEN 4304/5365 DIP 7
pyramid. A bilinear interpolation filter was used.
Subband coding
A 2-band subband coding and decodingcoding and decoding system (analysis and synthesis filter banks)
Magnitude frequency
Spring 2008 ELEN 4304/5365 DIP 8
g q yresponses of the analysis filter bank FIR filters (half-band filters).
4/28/2008
5
Subband codingFilter 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 Which is called perfect reconstruction conditions that require
ˆ ( ) ( )f n f n=
0 1( ) ( 1) ( )ng n h n= −
Spring 2008 ELEN 4304/5365 DIP 9
11 0( ) ( 1) ( )ng n h n+= −
10 1
1 0
( ) ( 1) ( )
( ) ( 1) ( )
n
n
g n h n
g n h n
+= −
= −
or
Subband codingFilters must satisfy biorthogonality condition
{ }(2 ), ( ) ( ) ( ); , 0,1i jh n k g k i j n i jδ δ− = − =
inner product
Of special interest are filters satisfying orthonormality condition
{ }( ), ( 2 ) ( ) ( ); , 0,1i jg n g n m i j m i jδ δ+ = − =
which satisfy the conditions
Spring 2008 ELEN 4304/5365 DIP 10
{ }1 0( ) ( 1) ( 1 )( ) ( 1 ), 0,1
neven
i i even
g n g K nh n g K n i
= − − −
= − − =
An orthonormal filter bank can be designed from a single prototypefilter; all other filters are computed from the prototype.
4/28/2008
6
Subband coding
A 2D 4-band subband coding (analysis) filt b kfilter bank.
Spring 2008 ELEN 4304/5365 DIP 11
A 2D 4-band subband decoding (synthesis) filter bank will have a reversed structure.
Subband coding
A 4-band approximation
t
A 4-band vertical d t ilcomponent
A 4-band
detail component
A 4-band
Spring 2008 ELEN 4304/5365 DIP 12
horizontal detail component
diagonal detail component
4/28/2008
7
Haar transformThe Haar transform can be expressed in the matrix form:
TT = HFHT HFHNxN image
NxN Haar transformation matrixNxN transformed image
The Haar basis functions are
[ ]0 001( ) ( ) , 0,1h z h z zN
= = ∈
Spring 2008 ELEN 4304/5365 DIP 13
[ ]
2
2
2 ( 1) 2 ( 0.5) 21( ) ( ) 2 ( 0.5) 2 2
0 , 0,1
p p p
p p pk pq
q z qh z h z q z q
Notherwise z
⎧ − ≤ < −⎪
= = − − ≤ <⎨⎪ ∈⎩
Haar transformA 2x2 Haar transformation matrix is:
2
1 11 ⎡ ⎤= ⎢ ⎥H2 1 12 ⎢ ⎥−⎣ ⎦
H
And a 4x4 Haar transformation matrix is:
1 1 1 11 1 1 11
⎡ ⎤⎢ ⎥− −⎢ ⎥H
Spring 2008 ELEN 4304/5365 DIP 14
4 2 2 0 040 0 2 2
⎢ ⎥= ⎢ ⎥−⎢ ⎥⎢ ⎥−⎣ ⎦
H
4/28/2008
8
Haar transformDiscrete 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!
Spring 2008 ELEN 4304/5365 DIP 15
64x64, 128x128, and 256x256 approximations derived from the DWT.
DWT in 1Ddetails
A two-stage analysis filter bank:
approximation
analysis filter-bank: Direct DWT
Spring 2008 ELEN 4304/5365 DIP 16
Bandwidths
4/28/2008
9
DWT in 1D
A two-stage synthesis filter-bank: Inverse DWT
Spring 2008 ELEN 4304/5365 DIP 17
DWT in 2DDWT is a separable transform…One stage 2D analysis bank LPF
LPF
HPF
HPF
HPF
One-stage 2D analysis bank
Two-stage decomposition
LPF
Spring 2008 ELEN 4304/5365 DIP 18
One-stage 2D synthesis bank
4/28/2008
10
DWT in 2D
Original One-scaleOriginal image
One scale 2D DWT
Spring 2008 ELEN 4304/5365 DIP 19
Two-scale 2D DWT
Three-scale 2D DWT
DWT in 2DZeroing 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
4/28/2008
11
DWT in 2DA CT image uniformly corrupted with white noise;
It is possible to attenuate (orIt is possible to attenuate (or completely remove) noise by the thresholding detail coefficients at a selected level.
Hard (zeroing details) or soft thresholding (zeroing details and
Spring 2008 ELEN 4304/5365 DIP 21
thresholding (zeroing details and scaling the non-zero coefficients toward zero) can be implemented
Information removed is shown on the right.
Wavelet packetsDetail channels can be further split…
Structure and bandwidths of a three-scale full wavelet
Spring 2008 ELEN 4304/5365 DIP 22
packet analysis tree.