Sunteți pe pagina 1din 12

4/28/2008

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

Base level J is of size 2J ⋅ 2J = N ⋅ N


where J = log 2 N
Spring 2008 ELEN 4304/5365 DIP 3

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)

Both operations are usually followed by approximation and


interpolation filters.

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

Of special interest are filters satisfying orthonormality condition


g i (n), g j (n + 2m) = δ (i − j )δ (m); i, j = {0,1}
which satisfy the conditions
g1 (n) = (−1) n g 0 ( K even − 1 − n)
hi (n) = gi ( K even − 1 − n), i = {0,1}
An orthonormal filter bank can be designed from a single prototype
filter; all other filters are computed from the prototype.
Spring 2008 ELEN 4304/5365 DIP 10

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

The Haar basis functions are


1
h0 ( z ) = h00 ( z ) = , z ∈ [ 0,1]
N
⎧2 p 2 (q − 1) 2 p ≤ z < (q − 0.5) 2 p
1 ⎪ p2
hk ( z ) = hpq ( z ) = ⎨ −2 (q − 0.5) 2 p ≤ z < q 2 p
N⎪
⎩0 otherwise, z ∈ [ 0,1]

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!

64x64, 128x128, and


256x256 approximations
derived from the DWT.
Spring 2008 ELEN 4304/5365 DIP 15

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

A two-stage synthesis filter-bank: Inverse DWT

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

One-stage 2D synthesis bank

Spring 2008 ELEN 4304/5365 DIP 18

9
4/28/2008

DWT in 2D

Original One scale


One-scale
image 2D DWT

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.

Hard (zeroing details) or soft


thresholding (zeroing details and
scaling the non-zero coefficients
toward zero) can be implemented

Information removed is shown


on the right.
Spring 2008 ELEN 4304/5365 DIP 21

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

A fingerprint and its three-scale full wavelet packet decomposition.


We see that some channels contains nearly no data!
Spring 2008 ELEN 4304/5365 DIP 23

Wavelet packets
An optimal wavelet
packet decomposition

Spring 2008 ELEN 4304/5365 DIP 24

12

S-ar putea să vă placă și