You are on page 1of 206

DIGITAL IMAGE PROCESSING - 2

U4 Lec 34: Wavelet Based Image


Processing

Dr. Shruthi M L J
Department of Electronics &
Communication Engineering

1
DIGITAL IMAGE PROCESSING - 2
This Session

• Introduction to wavelet transforms


• Joint Time Frequency Analysis (JTFA)
• Short Time Fourier Transforms (STFT)

4
DIGITAL IMAGE PROCESSING - 2
Linear Transforms

• These transforms, decompose functions into weighted sums of


orthogonal or biorthogonal basis functions

• can be studied using the tools of linear algebra and functional


analysis.

• Images are vectors in the vector space of all images

• Basis functions determine the nature and usefulness of image


transforms

• Transforms are the coefficients of linear expansions


5
DIGITAL IMAGE PROCESSING - 2
Linear Transforms

• For a given image and transform (or set of basis functions), both the
orthogonality of the basis functions and the coefficients of the resulting
transform are computed using inner products

• All of an image’s transforms are equivalent in the sense that they contain
the same information and total energy

• They are reversible and differ only in the way that the information and
energy is distributed among the transform’s coefficients

6
DIGITAL IMAGE PROCESSING - 2
Fourier Transforms

• Used to find the frequency content of a signal

• FT of a time domain signal gives the frequency-amplitude


representation of that signal

7
DIGITAL IMAGE PROCESSING - 2
Why Frequency Domain?

• Spectral extent of the signal can be known

• Results in simple mathematical operations to evaluate system behaviour

• Number of tools available to analyse stability & response of systems (in


‘s’ and ‘z’ domains)

8
DIGITAL IMAGE PROCESSING - 2
Time - Frequency Representations

• Time Domain

• Frequency Domain

9
DIGITAL IMAGE PROCESSING - 2
Time - Frequency Representations Cont..

• Time Domain:

• Frequency Domain (One sided spectrum)

10
DIGITAL IMAGE PROCESSING - 2
Example

Consider
x(t)=cos(210t)+cos(225t)+cos(250t)+cos(2 100t)

11
DIGITAL IMAGE PROCESSING - 2
Example

Fourier Transform of x(t)=cos(210t)+cos(225t)+cos(250t)+cos(2 100t) is

12
DIGITAL IMAGE PROCESSING - 2
Example
Now consider a non statioanry signal
The interval 0 to 300 ms has a 100 Hz sinusoid,
the interval 300 to 600 ms has a 50 Hz sinusoid,
the interval 600 to 800 ms has a 25 Hz sinusoid,
and finally the interval 800 to 1000ms has a 10Hz sinusoid

13
DIGITAL IMAGE PROCESSING - 2
Example
Its Fourier Transform is

FT of nonstationary signal

FT of stationary signal
14
Ft
DIGITAL IMAGE PROCESSING - 2
FFT of stationary and nonstationary signals

t1=0:.01:3 x=[sin(2*pi*t1) sin(2*pi*2*t2) sin(2*pi*3*t3)]


x=sin(2*pi*t1)+sin(2*pi*2*t1)+sin(
2*pi*3*t1)

FFT of the above signal FFT of the above signal 15


DIGITAL IMAGE PROCESSING - 2
Limitations of Fourier Transforms

• Other than the ripples, and the difference in amplitude, both the
spectra are almost identical.

• FT gives the spectral content of the signal, but it gives no information


regarding where in time those spectral components appear.

• FT is not a suitable technique for non-stationary signals.

16
DIGITAL IMAGE PROCESSING - 2
Joint Time-Frequency

• Ideally, tool should give instantaneous Fourier Transform of


the signal (X(t , F))
• Should track exactly frequency changes of the signal

• Need basis functions that capture this behaviour

• Should contain two parameters (t and F) which determine


instantaneous frequency spectrum

17
DIGITAL IMAGE PROCESSING - 2
Joint Time-Frequency

• Music
Score

• Ideal
Time/frequ
ency
behaviour

18
DIGITAL IMAGE PROCESSING - 2
Joint Time-Frequency
Time-frequency Plane

A standard basis function, its spectrum, and location


in the time-frequency plane.

Basis function localization in the


time-frequency plane. A complex sinusoidal basis function (with its real and imaginary parts
shown as solid and dashed lines, respectively), its spectrum, and
location in the time-frequency plane.
19
DIGITAL IMAGE PROCESSING - 2
Joint Time-Frequency

• Then the energy of basis function, is concentrated at on the


time-frequency plane.
• The majority of the energy falls in a rectangular region, called a
Heisenberg box or cell, of area such that

• Since the support of a function can be defined as the set of points where
the function is nonzero, Heisenberg’s uncertainity principle tells us that it
is impossible for a function to have finite support in both time and
frequency.
• This is called the Heisenberg-Gabor inequality that places a lower bound
on the area of the Heisenberg cell revealing that and cannot both
be arbitrarily small.

20
DIGITAL IMAGE PROCESSING - 2
Joint Time-Frequency Analysis (JTFA)

Time frequency localization


• Uncertainty Principle
• If x(n) has a wide support then X (e j ) has narrow
support in      
• Both time frequency localization is not possible in Fourier
Transform
• Also if the frequency varies with time(like in music/audio)
then the variation is lost
• Transforms suitable for non-stationary signals
• Short Time Fourier Transforms
• Wavelet Transform
21
DIGITAL IMAGE PROCESSING - 2
Joint Time-Frequency Analysis (JTFA)

• One method to get JTF is to chop the signal(rectangular


window) and perform FT analysis for short time

• Second method is to use non rectangular windows:


• Raised cosine

• Gabor

• If shape of signal matches shape of window we get large


coefficient values
22
DIGITAL IMAGE PROCESSING - 2
Short Time Fourier Transform(STFT)

• In STFT, the signal is divided into small enough


segments, where these segments (portions) of the
signal can be assumed to be stationary.
• For this purpose, a window function "w" is chosen.
The width of this window must be equal to the
segment of the signal where it is stationary.

STFTX( ) (t, f ) = ò x(t) (t  t ' )e  j2 ft dt

23
DIGITAL IMAGE PROCESSING - 2
Short Time Fourier Transform(STFT)

These will correspond to three different FTs at three


different times. Therefore, we will obtain a true time-
frequency representation (TFR) of the signal.
24
DIGITAL IMAGE PROCESSING - 2
Short Time Fourier Transform(STFT)

• Multiplying signal with shifted window

f w (t ) = f (t ) w(t  a)

• Taking its Fourier transform


¥
1
X w ( ,a) = ò f (t)w(t  a)e  jt dt
2 ¥

• For discrete time functions


¥
X ( , m) =  x (
n = ¥
n ) w( n  m )e  j n

25
DIGITAL IMAGE PROCESSING - 2
STFT Cont..

• We obtain STFT with 2 variables ω and m where ω is


continuous and m is an integer multiple of some fixed k
• For any fixed m, window captures the features of the signal
x(n) in local region around m. Thus the window localizes the
time domain data before obtaining frequency information
• If w=1 this reduces to traditional DTFT for any m
• STFT always exists as the window is of fixed and finite
duration.
• So it always converges unlike FT where x(t) has to follow Dirichlet
conditions.

26
DIGITAL IMAGE PROCESSING - 2
Time Frequency Tile of STFT

∆t

Ωc ∆Ω

t
tc
27
DIGITAL IMAGE PROCESSING - 2

Heisenberg’s Uncertainty Principle


• ω and t are not sharp variables. They give information in the
neighbourhood of t and ω.The width of window in time and
frequency should be as small as possible for localization. But
width in time and frequency can’t be arbitrarily small at same
time 1
t 
2
• Window of STFT has fixed width
• All time and frequency are resolved equally well or equally
bad
• In practical situation it is desired that the window size is
made variable with variable bandwidths
• For slowly varying signals the width should be wider with
narrow bandwidth and opposite for fast varying signals
28
DIGITAL IMAGE PROCESSING - 2

• Perfect frequency resolution in the FT is due to the fact that the window used in the
FT is its kernel, the ejt function, which lasts at all times from minus infinity to plus
infinity. But time information is lost.

• Narrow window ===> good time resolution, poor frequency resolution.

• Wide window ===> good frequency resolution, poor time resolution


29
DIGITAL IMAGE PROCESSING - 2

U4 Lec 35: Wavelet Based Image


Processing

Dr. Shruthi M L J
Department of Electronics &
Communication Engineering

1
DIGITAL IMAGE PROCESSING - 2
This Session

• STFT Cont..
• Introduction to Wavelet transforms

4
DIGITAL IMAGE PROCESSING - 2

• Perfect frequency resolution in the FT is due to the fact that the window used in the
FT is its kernel, the ejt function, which lasts at all times from minus infinity to plus
infinity. But time information is lost.

• Narrow window ===> good time resolution, poor frequency resolution.

• Wide window ===> good frequency resolution, poor time resolution


5
DIGITAL IMAGE PROCESSING - 2

Disadvantages of STFT

• Considers a high frequency and a low frequency signal


with a constant width window to compute STFT
• For HF many cycles are captured by the window.

• For LF very few cycles are within the window

• Thus accuracy of estimate of FT is poorer at LF

• The Bandwidths are same in STFT which is a


disadvantage. It should increase with frequency
6
DIGITAL IMAGE PROCESSING - 2

Choice of Window
• It would be appropriate to have a narrow window if frequency
is high and wide window if signal changes slowly

• It would be preferred to have window whose width adjusts


itself with frequency

• Multiresolution feature

• Human ear & eye (HVS) have decreasing resolution at


high frequencies: multiresolution feature

• Wavelet transform addresses this problem of time-frequency


resolution by having variable window 7
DIGITAL IMAGE PROCESSING - 2
Fourier Vs. Wavelet Transform

Fourier transform Wavelet transform


• Gives information in • Gives information in both
frequency domain. frequency and time
domains.
• Ideal for stationary data, • Gives both time – frequency
but not suitable for localization by dividing
transient signals. Reason: signals into components
Heisenberg Uncertainity that are not pure sine waves
Principle.

• STFT gives a fixed • Gives variable resolution


resolution.
8
DIGITAL IMAGE PROCESSING - 2

9
DIGITAL IMAGE PROCESSING - 2
Wavelet Transforms

Fourier Transform (1807, Not suitable for non-stationary signals)

Short-Time Fourier Transform (1946, Fixed window size)

Wavelet Transform (1987,Variable window)


Discrete Wavelet Transform(1990)
•Scaling function (Low frequency component)
•Wavelet function(mother wavelet) (High Frequency Component)

10
DIGITAL IMAGE PROCESSING - 2
History of Wavelets

• 1910, Haar families.


• 1981, Morlet, wavelet concept.
• 1984, Morlet and Grossman, ”wavelet”.
• 1985, Meyer, ”orthogonal wavelet”.
• 1988, Mallat and Meyer, multiresolution.
• 1988, Daubechies, compact support orthogonal wavelet.
• 1989, Mallat, fast wavelet transform
• 1990 onwards, applied to signal processing and other
Engineering applications

11
DIGITAL IMAGE PROCESSING - 2
Wavelet Transforms

• Mathematicians discovered the transform in the first


decade of last century(20th)
• Wavelets were first used for signal processing in 1986
by Stephane Mallat.
• Since then there has been revolution in wavelet based
systems & in last 4 decades the transform has been
extensively used by researchers to solve technical
problems in various disciplines.

12
DIGITAL IMAGE PROCESSING - 2
Wavelets (Introduction)
• Unlike Fourier transform, whose basis functions are
sinusoids, basis function of wavelet transforms are
non sinusoidal
• Based on small waves, called wavelets, of limited duration.
• Fourier transform provides only frequency
information, but wavelet transform provides time-
frequency information.
• Wavelets lead to a multiresolution analysis of signals.
• Multiresolution analysis: Representation of a signal
(e.g., images) in more than one resolution/scale.
• Features that might go undetected at one resolution may
be easy to spot in another.
13
DIGITAL IMAGE PROCESSING - 2
Multiresolution

• Small objects are viewed at high


resolutions.
• Large objects require only a coarse
resolution.
• Images have locally varying statistics
resulting in combinations of edges,
abrupt features and homogeneous
regions.
• Hence multiresolution analysis is
most suitable

14
DIGITAL IMAGE PROCESSING - 2
Image pyramids

• Originally devised for machine vision and image compression

• It is a collection of images at decreasing resolution levels.

15
DIGITAL IMAGE PROCESSING - 2
Image pyramids

16
DIGITAL IMAGE PROCESSING - 2
Image pyramids

• At each level we have an approximation image and a residual


image.
• The original image (which is at the base of pyramid) and its P
approximations form the approximation pyramid.
• The residual outputs form the residual pyramid.
• Approximation and residual pyramids are computed in an
iterative fashion.
• A P+1 level, pyramid is built by executing the operations in the
block diagram P times.

17
DIGITAL IMAGE PROCESSING - 2
Image pyramids

• During the first iteration, the original image is applied as the


input image.
• This produces the level J-1 approximate and level J prediction
residual results

18
DIGITAL IMAGE PROCESSING - 2
Image pyramids

• Each iteration is composed of three sequential steps:


1. Compute a reduced resolution approximation of the
input image. This is done by filtering the input and
Down sampling (subsampling) the filtered result by a
factor of 2.
• Filter: neighborhood averaging, Gaussian filtering
• The quality of the generated approximation is a
function of the filter selected

19
DIGITAL IMAGE PROCESSING - 2
Image pyramids

2. Up sample output of the previous step by a factor of 2


and filter the result. This creates a prediction image with
the same resolution as the input.
• By interpolating intensities between the pixels of step 1,
the interpolation filter determines how accurately the
prediction approximates the input to step 1.
3. Compute the difference between the prediction of step 2
and the input to step 1. This difference can be later used
to reconstruct progressively the original image

20
DIGITAL IMAGE PROCESSING - 2
Approximation and Residual Pyramids

21
DIGITAL IMAGE PROCESSING - 2
Wavelet Theory

Reasons For Using Wavelets


• To get both time and frequency resolution which cannot be
obtained using Fourier transform as it gives only frequency
resolution but no time resolution.
• In the case of wavelets we normally speak of time-scale
representations, scale being the opposite of frequency.

22
DIGITAL IMAGE PROCESSING - 2
Wavelet Theory Cont..

• It is a spectral analysis method that allows time frequency


localization unlike Fourier transform which allows only
frequency localization.
• It is a method of analyzing signal with short duration finite
energy functions.
• Wavelets are mathematical functions that cut up data into
different frequency components, and then study each
component with a resolution matched to its scale.

23
DIGITAL IMAGE PROCESSING - 2
Wavelet Theory Cont..

• In wavelet analysis, a fully scalable modulated window is used


for cutting the signal.
• The window is shifted along the signal and for every position
the spectrum is calculated.
• Then this process is repeated with shorter(or longer) window
for every new cycle.
• The result will be a collection of time-frequency
representations of the signal with different resolutions. Hence
called Multi-Resolution Analysis.

24
DIGITAL IMAGE PROCESSING - 2
Time-frequency tiles

25
DIGITAL IMAGE PROCESSING - 2

With a smaller window size

The graph is symmetric with respect to midline of the frequency axis.


FT of a real signal is always symmetric, since STFT is nothing but a
windowed version of the FT, it should also be symmetric 26
DIGITAL IMAGE PROCESSING - 2

With a larger window size

(frequencies are resolved better) 27


DIGITAL IMAGE PROCESSING - 2

Further increase in window size

(frequency resolution further improves) 28


DIGITAL IMAGE PROCESSING - 2
Time Frequency Resolution

• Higher frequencies are better resolved in time,


and lower frequencies are better resolved in
frequency

frequency

|****************************************
|* * * * * * * * * * * * * * *
|* * * * * * *
|* * * *
|* *
--------------------------------------------> time
29
DIGITAL IMAGE PROCESSING - 2
Wavelet Transforms
• Wavelet means small wave. So wavelet analysis is about
analysing signal with short duration finite energy functions
• The transformation is called wavelet transform
• The wavelet is made to scan the signal with varying
translations and dilations
• The wavelet plot shows correlation between wavelet at some
scale & location of the signal

30
DIGITAL IMAGE PROCESSING - 2
Wavelet transforms
• Wavelet function (basis) is given by:

1 t b
 ab (t )   
a  a 
• Wavelet transform is defined as
W (a, b)   f (t ) a ,b (t )dt
t

1 t b
  f (t )  dt
t a  a 

• For every a,b we have a wavelet coefficient representing how much


the scaled wavelet is similar to the function at location t=b 31
DIGITAL IMAGE PROCESSING - 2
CWT and DWT

• CWT is a function of 2 parameters a and b which vary


continuously. This would contain extra(redundant)
information while analyzing a function.
• CWT provides redundant representation of a signal
• Entire support of W(a,b) is not necessary to recover f(t)
• Representing a signal with DWT is a non redundant
wavelet representation
• Instead of continuously varying the parameters, signal can
be analyzed with small number of scales with varying
number of translates at each scale. This leads to DWT.
• It may be viewed as discretization of CWT through sampling
a and b.

32
DIGITAL IMAGE PROCESSING - 2
Continuous Wavelet Transform

• CWT is given by

1 t b
W (a, b)   f (t )  dt
t a  a 

• Critical sampling of CWT is obtained via a = 2-j (also called as


dyadic sampling) where j is set of discrete dilation

33
DIGITAL IMAGE PROCESSING - 2
Discrete Wavelet transforms

• We analyze a signal using the combination of scaling function


and wavelet function.
• If we consider wavelet transform as a filter bank, then we
consider wavelet transforming the signal as passing the signal
through the filter bank. The outputs of the different filter
stages are the scaling function and wavelet transform
coefficients.
• This is same as Sub Band Coding.

34
DIGITAL IMAGE PROCESSING - 2

35
DIGITAL IMAGE PROCESSING - 2

U4 Lec 36: Wavelet Based Image


Processing

Dr. Shruthi M L J
Department of Electronics &
Communication Engineering

1
DIGITAL IMAGE PROCESSING - 2
This Session

• Introduction to wavelet transforms


• CWT Vs DWT
• Scaling and wavelet functions

4
DIGITAL IMAGE PROCESSING - 2
Time-frequency tiles

5
DIGITAL IMAGE PROCESSING - 2

With a smaller window size

The graph is symmetric with respect to midline of the frequency axis.


FT of a real signal is always symmetric, since STFT is nothing but a
windowed version of the FT, it should also be symmetric 6
DIGITAL IMAGE PROCESSING - 2

With a larger window size

(frequencies are resolved better) 7


DIGITAL IMAGE PROCESSING - 2

Further increase in window size

(frequency resolution further improves) 8


DIGITAL IMAGE PROCESSING - 2
Time Frequency Resolution

• Higher frequencies are better resolved in time, and lower


frequencies are better resolved in frequency

frequency
|****************************************
|* * * * * * * * * * * * * * *
|* * * * * * *
|* * * *
|* *
--------------------------------------------> time

9
DIGITAL IMAGE PROCESSING - 2
Time-frequency Localization

Time and frequency localization of 128-point Daubechies basis functions.


10
DIGITAL IMAGE PROCESSING - 2
Wavelet Transforms

• Wavelet means small wave. So wavelet analysis is about


analysing signal with short duration finite energy functions

• The transformation is called wavelet transform

• The wavelet is made to scan the signal with varying


translations and dilations

• The wavelet plot shows correlation between wavelet at some


scale (frequency) & location of the signal

11
DIGITAL IMAGE PROCESSING - 2
Wavelet transforms
• Wavelet function (basis) is given by:
1 t b
 ab (t )   
a  a 

• Wavelet transform is defined as

W (a, b)   f (t ) a ,b (t )dt
t

1 t b
 f (t )   dt
t a  a 

• For every a,b we have a wavelet coefficient representing how much


the scaled wavelet is similar to the function at location t=b 12
DIGITAL IMAGE PROCESSING - 2
CWT and DWT

• CWT is a function of 2 parameters a and b which vary


continuously. This would contain extra(redundant)
information while analyzing a function.
• CWT provides redundant representation of a signal
• Instead of continuously varying the parameters, signal can
be analyzed with small number of scales with varying
number of translates at each scale. This leads to DWT.
• Representing a signal with DWT is a non redundant
wavelet representation

• It may be viewed as discretization of CWT through sampling


a and b

13
DIGITAL IMAGE PROCESSING - 2
Sampling Continuous Wavelet Transform

• CWT is given by

1 t b
W (a, b)   f (t )  dt
t a  a 

• Critical sampling of CWT is obtained via a = 2-j (also called as


dyadic sampling) where j is set of discrete dilation

14
DIGITAL IMAGE PROCESSING - 2
Discrete Wavelet transforms

• We analyze a signal using a combination of scaling function


and wavelet function.
• If we consider wavelet transform as a filter bank, then we
consider wavelet transforming the signal as passing the signal
through the filter bank.
• The outputs of different filter stages are the scaling function and
wavelet transform coefficients
• This is same as Sub band Coding.

15
DIGITAL IMAGE PROCESSING - 2
Sub band Coding

16
DIGITAL IMAGE PROCESSING - 2
Decomposition using DWT

17
DIGITAL IMAGE PROCESSING - 2

U4 Lec 37: Wavelet Based Image


Processing

Dr. Shruthi M L J
Department of Electronics &
Communication Engineering

1
DIGITAL IMAGE PROCESSING - 2
This Session

• Discrete Wavelet Transforms (DWT)


• Scaling and wavelet functions

4
DIGITAL IMAGE PROCESSING - 2
Sampling Continuous Wavelet Transform

• CWT is given by

1 t b
W (a, b)   f (t )  dt
t a  a 

• Critical sampling of CWT is obtained via a = 2-j (also called as


dyadic sampling) where j is set of discrete dilation

5
DIGITAL IMAGE PROCESSING - 2
Discrete Wavelet transforms

• We analyze a signal using a combination of scaling function


and wavelet function.
• If we consider wavelet transform as a filter bank, then we
consider wavelet transforming the signal as passing the signal
through the filter bank.
• The outputs of different filter stages are the scaling function and
wavelet transform coefficients
• This is same as Sub band Coding.

6
DIGITAL IMAGE PROCESSING - 2
Sub band Coding

7
DIGITAL IMAGE PROCESSING - 2
Decomposition using DWT

8
DIGITAL IMAGE PROCESSING - 2
Multiresolution Expansions

• Series Expansions
Any function can be expressed as linear combination of basis
functions

where

Dual function of
* Complex conjugate operation
9
DIGITAL IMAGE PROCESSING - 2
Multiresolution Expansions

• Thus any function f(t) can be represented as linear


combination of expansion functions

f (t)  å ak k (t)


k

• k is integer index
• ak is real valued expansion coefficient
• k(t) is set of real valued functions of t called expansion set

10
DIGITAL IMAGE PROCESSING - 2
Multiresolution Expansions

• If expansion set is unique it is called a basis


• The vectors of the basis are linearly independent.
• It spans the vector space L2 (R) .
• If basis is orthogonal then,

11
DIGITAL IMAGE PROCESSING - 2
Spanning set

• If each vector in a vector space can be expressed as the linear


combination of a particular set of vectors w1, w2, w3,…
then this set of vectors form a spanning set & it spans the vector
space.

12
DIGITAL IMAGE PROCESSING - 2
Wavelet Expansion

• For the wavelet expansion a two parameter system is


constructed such that
Wavelet Coefficients
f (t )  åå a j ,k  j ,k (t )
k j
aj,k are called Discrete Wavelet Transform of f(t)

13
DIGITAL IMAGE PROCESSING - 2

Characteristics of Wavelet Coefficients

aj,k is not unique but they all have the following


properties:

1. It is a set of building blocks to construct a signal or


function
2. It gives time frequency localization
3. The calculation of coefficients can be done
efficiently, many can be calculated with O(N)
operations.

14
DIGITAL IMAGE PROCESSING - 2

Additional Characteristics

4. All wavelet functions are generated from single wavelet by


simple scaling & translation
 j , k (t )  2 j / 2  ( 2 j t  k ); j , k  Z

5. They satisfy multiresolution condition.

If a set of signals can be represented by a weighted sum of


x(t-k), then a larger set can be represented by x(2t-k).

6. The lower resolution coefficients can be calculated from


higher resolution coefficients by a tree structured algorithm.
15
DIGITAL IMAGE PROCESSING - 2
Multiresolution Analysis (MRA)

• In addition to wavelet (t) we need another basis function


called scaling function (t) to represent the signal.

• Goal To generate set of expansion functions such that any


signal in L2(R) can be represented by the series

 k (t )  (t  k ); k  Z ,   L2 ( R )

16
DIGITAL IMAGE PROCESSING - 2
Scaling function

Let us define,
 k (t )  (t  k ); k  Z ,   L2 ( R )

The subspace of L2 (R) spanned by these functions is defined as

 0  Span k (t ) int k


f (t )  å ak  k (t ); f (t )   0
k

17
DIGITAL IMAGE PROCESSING - 2
Expansion using Scaling function
• A 2-D family of functions is generated from basic scaling function
 j ,k (t )  2 j / 2 (2 j t  k ); j , k  Z
Whose span over k is  j  Span k (2 j t ) int k

• In this equation, integer translation k determines the position of


along the x-axis and scale j determines its shape—i.e., its width and
amplitude.
• If we restrict j to some value, say j = j0, then is the basis
of the function space spanned by the for j = j0 and
k = ..., −1, 0, 1, 2, ..., denoted Vj0 .
• Increasing j0 increases the number of representable functions in Vj0,
allowing functions with smaller variations and finer detail to be
included in the space 18
DIGITAL IMAGE PROCESSING - 2
Expansion using Scaling function

• If
f (t)   j
f (t)  å akj k (2 j t  k)
k
• For j>0 the span can be larger thus representing finer
details

• For j<0 the span is smaller the scaling function is wider &
translated in larger steps thus representing coarse
information.

19
DIGITAL IMAGE PROCESSING - 2
Scaling function

• (t) is weighted sum of shifted (2t)

\j (t)  å g(n) 2j (2t  n),n  Z


n

• g(n) are sequence of real or complex numbers called


scaling coefficients & 2 maintains norm of the
scaling function.

20
DIGITAL IMAGE PROCESSING - 2
Multiresolution Analysis (MRA)

• The basic requirement of MRA is requiring a nesting of the


spanned spaces as

2  1  0  1  2 ........ L (R) 2

 j   j1j Z

• Elements in a space are simply scaled versions of elements


of next space

21
DIGITAL IMAGE PROCESSING - 2
Nested Vector Space

V3

V2

V1

V0

2  1  0  1  2 ........ L (R)


2

 j   j1j Z 22
DIGITAL IMAGE PROCESSING 2

U4 Lec 38-39: Wavelet Based Image


Processing

Dr. Shruthi M L J
Department of Electronics &
Communication Engineering

1
DIGITAL IMAGE PROCESSING 2
This Session

• Discrete Wavelet Transforms (DWT)


• Scaling and wavelet functions
• Signal decomposition using scaling and wavelet functions

4
DIGITAL IMAGE PROCESSING 2
Scaling function

Let us define,
 k (t )  (t  k ); k  Z ,   L2 ( R )

The subspace of L2 (R) spanned by these functions is defined as

 0  Span k (t ) int k


f (t )   ak  k (t ); f (t )   0
k

5
DIGITAL IMAGE PROCESSING 2
Expansion using Scaling function
• A 2-D family of functions is generated from basic scaling function
 j ,k (t )  2 j / 2 (2 j t  k ); j , k  Z
Whose span over k is  j  Span k (2 j t ) int k

• In this equation, integer translation k determines the position of


along the x-axis and scale j determines its shape—i.e., its width and
amplitude.
• If we restrict j to some value, say j = j0, then is the basis
of the function space spanned by the for j = j0 and
k = ..., −1, 0, 1, 2, ..., denoted Vj0 .
• Increasing j0 increases the number of representable functions in Vj0,
allowing functions with smaller variations and finer detail to be
included in the space 6
DIGITAL IMAGE PROCESSING 2
Expansion using Scaling function

• If
f (t)   j
f (t)   akj k (2 j t  k)
k
• For j>0 the span can be larger thus representing finer
details

• For j<0 the span is smaller the scaling function is wider &
translated in larger steps thus representing coarse
information.

7
DIGITAL IMAGE PROCESSING 2
Scaling function

• (t) is weighted sum of shifted (2t)

\j (t)   g(n) 2j (2t  n),n  Z


n

• g(n) are sequence of real or complex numbers called


scaling coefficients & 2 maintains norm of the
scaling function.

8
DIGITAL IMAGE PROCESSING 2
Multiresolution Analysis (MRA)

• The basic requirement of MRA is requiring a nesting of the


spanned spaces as

2  1  0  1  2 ........ L (R) 2

 j   j1j Z

• Elements in a space are simply scaled versions of elements


of next space

9
DIGITAL IMAGE PROCESSING 2
Nested Vector Space

V3

V2

V1

V0

2  1  0  1  2 ........ L (R)


2

 j   j1j Z 10
DIGITAL IMAGE PROCESSING 2
Scaling and Wavelet Function

• To describe the important features of a signal we don’t need


only j,k(t) with increasing j to increase size of subspace
spanned by scaling functions(more redundancy) but also the
high frequency details

• We define set of functions j,k(t) that spans the differences


between the spaces spanned by various scales of scaling
functions. These are called wavelets.

11
DIGITAL IMAGE PROCESSING 2
Scaling and Wavelet Function

V3
W1 W2
W0
V2

V1

V0

j,k(t) & j,k(t) are required to be orthogonal for energy


preservation & also for ease in coefficient calculation
12
DIGITAL IMAGE PROCESSING 2
Scaling and Wavelet Function

• Scaling and wavelet function subspaces are related by

V j 1  V j  W j

• All members of Vj are orthogonal to members of Wj

• The scaling function associated with a good wavelet usually has


a shape similar to the shape of the given signal.

13
DIGITAL IMAGE PROCESSING 2
Signal Representation using Scaling and Wavelet Function

• The space of all measurable square integrable functions can


be expressed as

L ( R )  V j 0  W j 0  W j 0 1...
2

 (t)   g(n) 2 (2t  n)


n

 (t)   h(n) 2 (2t  n)


n

14
DIGITAL IMAGE PROCESSING 2
Approximation and Residual Pyramids

• Any function f(t) can be represented as



f (t )   c(k ) (t )   d ( j, k )
k  
k
j k
j ,k (t )

• The first summation gives a function that is a low resolution or


coarse approximation of f(t).
• For each increase in index j in the second summation a higher
or finer resolution is added.

15
DIGITAL IMAGE PROCESSING 2
Types of Wavelet families -Mother Wavelets

• Haar Wavelets

• Coiflet Wavelets

• Daubechies Wavelets (9/7)

• Bi-orthogonal Wavelets

• Symlets, Meyer, Morlet etc..

16
DIGITAL IMAGE PROCESSING 2
Haar Wavelets

 (t)   h(n) 2 (2t  n)


n

So wavelet filter coefficients     17


DIGITAL IMAGE PROCESSING 2
Coiflet Wavelets

Scaling function ϕ Wavelet function ψ

18
DIGITAL IMAGE PROCESSING 2
Daubechies Mother Wavelets

The next 9 members of the Daubechies Family


db1
Wavelet

19
DIGITAL IMAGE PROCESSING 2
Other Mother Wavelets

Symlet Wavelet

Morlet wavelet Mexican Hat wavelet Meyer wavelet 20


DIGITAL IMAGE PROCESSING 2
Multiresolution Expansions

Scaling Functions:
• Integer translations and dyadic scalings of a scaling function

• Express f(x) as combinations of

21
DIGITAL IMAGE PROCESSING 2

• Sketch the following using Haar scaling function φ(x):

1.
j 0,0 (x)
2.
j1,0 (x)
3.
j1,1 (x)

22
DIGITAL IMAGE PROCESSING 2

• Represent j 0,0 (x) using j1,0 (x) and j1,1 (x)

Also

1
j 0,0 (x)  j1,0 (x)
2
1
 j1,1 (x)
2
23
DIGITAL IMAGE PROCESSING 2
Example

• Given a function f(x) in V1 represent in terms of the


corresponding basis functions

24
DIGITAL IMAGE PROCESSING 2
Multiresolution Expansions

Wavelet Functions (Haar):


• Integer translations and dyadic scalings of a wavelet function
,
/ (
• Sketch the following using Haar wavelet function :
1. ,

2. ,

3. ,

25
DIGITAL IMAGE PROCESSING 2
Example

• Given a function f(x) in V1 represent in terms of the Haar


scaling and wavelet basis functions in V0, W0

1.25

0.75

26
DIGITAL IMAGE PROCESSING 2

U4 Lec 40: Wavelet Based Image


Processing

Dr. Shruthi M L J
Department of Electronics &
Communication Engineering

1
DIGITAL IMAGE PROCESSING 2
This Session

• 1D,2D DWT
• DWT applied to images

4
DIGITAL IMAGE PROCESSING 2
Continuous Wavelet Transforms

• Wavelet transform is defined as

W (a, b)   f (t ) a ,b (t )dt
t

1 t b
  f (t )  dt
t a  a 
• or every a,b we have a wavelet coefficient representing how
much the scaled wavelet is similar to the function at location
t=b

5
DIGITAL IMAGE PROCESSING 2
Properties of Wavelet

• The most important properties of wavelets are the


admissibility and the regularity conditions and these are the
properties, which give wavelets their name.
• The Admissibility condition:
 | ()|2 / || d < +
• The admissibility condition implies that the Fourier transform
of  (t) vanishes at the zero frequency i.e.
| ()|2|=0 = 0
• This means that wavelets must have a band-pass like
spectrum

6
DIGITAL IMAGE PROCESSING 2
Properties of Wavelet

• A zero at the zero frequency also means that the


average value of the wavelet in the time domain must
be zero,
  (t) dt = 0
and therefore it must be oscillatory.
In other words,  (t) must be a wave.
• A secondary condition imposed on wavelet is unit
energy 

2
 ( t ) dt  1
 
2
i .e ,  ( t )  1 7
DIGITAL IMAGE PROCESSING 2
Properties of Wavelet Cont..

Regularity conditions:
• Regularity conditions are imposed on the wavelet functions
in order to make the wavelet transform decrease quickly with
decreasing scale s.

Summarizing, the admissibility condition gave us the wave,


regularity conditions gave us the fast decay or the let, and
put together they give us the wavelet.

8
DIGITAL IMAGE PROCESSING 2
More Properties of Wavelets

1. Compact support: Each basis function in a wavelet series


has compact support.(makes it easy to concentrate
computation where activity is high).
2. Orthogonality: Information carried by one term is
independent of information carried by another term.
3. Multiresolution representation: Scalable mathematical
representation.

9
DIGITAL IMAGE PROCESSING 2
Selection of Basis Function

• In order to select suitable wavelet transform that matches physics of


the problem one has to study important properties of the transform
like smoothness, spatial localization, frequency localization & ability
to represent local polynomial function, orthogonality & symmetry.

• The scaling function associated with a good wavelet usually has a


shape similar to the shape of the given signal.

• Other important aspects to be considered are less noise sensitivity &


less quantization errors.

10
DIGITAL IMAGE PROCESSING 2
Approximation and Detail Coefficients of DWT

• Any function f(t) can be represented as



f (t )   c(k ) (t )   d ( j, k )
k  
k
j k
j ,k (t )

• The first summation gives a function that is a low resolution or


coarse approximation of f(t).
• For each increase in index j in the second summation a higher
or finer resolution is added.

11
DIGITAL IMAGE PROCESSING 2
Signal Representation using Scaling and Wavelet Function

• The space of all measurable square integrable functions can


be expressed as
L2 ( R )  V j 0  W j 0  W j 0 1...

 (t)   g(n) 2 (2t  n)


n

 (t)   h(n) 2 (2t  n)


n

12
DIGITAL IMAGE PROCESSING 2
Haar Scaling Function

ìï 1 ;0 £ x £ 1
 (x)  í
ïî 0 ;Otherwise

13
DIGITAL IMAGE PROCESSING 2
Multiresolution Expansions

• Scaling functions
• Dilation equation for scaling function

• are called scaling function coefficients


• Example: Haar wavelet,

14
DIGITAL IMAGE PROCESSING 2
Multiresolution Expansions

Wavelet functions

15
DIGITAL IMAGE PROCESSING 2
Haar Wavelets

 (t)   g(n) 2 (2t  n)


n

 (t)   h(n) 2 (2t  n)


n
Wavel t’s mother function is defined as
⎩ x)(  ⎩ 1, 1/2⎩ x<1,

⎩(x)⎩
⎩⎩ 0, otherwise.


⎩ 1, 0⎩ x<1/2,

⎩0, otherwise.
⎩1, if0 x<⎩ 1
Thus approximation filter coefficients    
⎩(x)2⎩(x1)

So wavelet filter coefficients     16


DIGITAL IMAGE PROCESSING 2
Haar Wavelets (2D)

• Thus, for N=2, the 2x2 transformation matrix is:

The rows of H2 are the simplest filters of length 2 that may be


used as analysis filters h0(n) and h1(n) of a perfect reconstruction
filter bank.
Moreover, they can be used as scaling and wavelet vectors
(defined in what follows) of the simplest and oldest wavelet
transform.

17
DIGITAL IMAGE PROCESSING 2
The Haar Transform

• Haar proposed the Haar Transform in 1910, more than 70 years


before the wavelet theory was born.

• Haar wavelet is the oldest and simplest wavelet basis.

• Haar wavelet is the only one wavelet basis, which holds the
properties of orthogonal, (anti-) symmetric and compactly
supported.

18
DIGITAL IMAGE PROCESSING 2
The Haar Wavelet Filters

19
DIGITAL IMAGE PROCESSING 2
Transformation using Haar Wavelet

20
DIGITAL IMAGE PROCESSING 2
DWT of an Image

Pyramidal structure when


DWT of an image is taken

21
DIGITAL IMAGE PROCESSING 2
DWT of an Image

Pyramidal structure when DWT of


an image is taken

22
DIGITAL IMAGE PROCESSING 2
DWT of an Image

23
DIGITAL IMAGE PROCESSING 2
Wavelet Decomposition

Original Lena image Lena image after 1-level of wavelet decomposition

24
DIGITAL IMAGE PROCESSING 2
4 – level Wavelet Decomposition of Lena

25
DIGITAL IMAGE PROCESSING 2
DWT

• DWT Represents signal as sum of wavelet functions and scaling


function.

• Scaling function  Low frequencies: smooth parts

• Wavelet functions High frequencies: detailed parts

26
DIGITAL IMAGE PROCESSING 2
Image Pyramids

• Originally devised for machine vision and image compression


• It is a collection of images at decreasing resolution levels.

27
DIGITAL IMAGE PROCESSING 2
Image Pyramids

• At each level we have an approximation image and a residual


image.
• The original image (which is at the base of pyramid) and its P
approximation form the approximation pyramid.
• The residual outputs form the residual pyramid.
• Approximation and residual pyramids are computed in an
iterative fashion.
• A P+1 level pyramid is built by executing the operations in the
block diagram P times.

28
DIGITAL IMAGE PROCESSING 2
Image Pyramids

• During the first iteration, the original image is applied as the


input image.
• This produces the level J-1 approximate and level J prediction
residual results
• For iterations j=J-1, J-2, …, J-p+1, the previous iteration’s level j-
1 approximation output is used as the input.

29
DIGITAL IMAGE PROCESSING 2
Image Pyramids

• Each iteration is composed of three sequential steps:


1. Compute a reduced resolution approximation of the input
image. This is done by filtering the input and Down sampling
(subsampling) the filtered result by a factor of 2.
• Filter: neighborhood averaging, Gaussian filtering
• The quality of the generated approximation is a function of
the filter selected
2. Up sample output of the previous step by a factor of 2 and
filter the result. This creates a prediction image with the
same resolution as the input.

30
DIGITAL IMAGE PROCESSING 2
Image Pyramids

• By interpolating intensities between the pixels of step 1,


the interpolation filter determines how accurately the
prediction approximates the input to step 1.
3. Compute the difference between the prediction of step 2
and the input to step 1. This difference can be later used to
reconstruct progressively the original image

31
DIGITAL IMAGE PROCESSING 2
Image Pyramids

32
DIGITAL IMAGE PROCESSING 2
Subband Coding

• In subband coding, an image is decomposed


into a set of bandlimited components, called
subbands.

• Since the bandwidth of the resulting subbands


is smaller than that of the original image, the
subbands can be downsampled without loss of
information.

33
DIGITAL IMAGE PROCESSING 2
2-Band Subband Coding

34
DIGITAL IMAGE PROCESSING 2
4-Band Subband Coding

35
DIGITAL IMAGE PROCESSING 2
Comparison of FFT,CWT,DWT

• FFT can be used for a stationary signal (single or multiple


frequencies) , as it provides accurate frequency values as compared
to CWT and DWT which provides an approximate frequency value for
the stationary signal.

• For applications where the frequency values play a very vital role and
where approximations cannot be tolerated FFT can be preferred to
wavelet transforms.

• Also computational complexity of FFT is lesser than that of the


wavelet transforms.
36
DIGITAL IMAGE PROCESSING 2
Comparison of FFT,CWT,DWT

• FFT can be used irrespective of shape of the signal , whereas for


wavelet transforms mother wavelet should be a bit similar to
general shape of the signal.

• FFT proves to be inadequate while dealing with non-stationary


signals , because it just detects the frequency components of
the signal irrespective of whether that frequency component is
present only in small time duration or complete duration. (As
seen in the FFT of the non-stationary signal)
37
DIGITAL IMAGE PROCESSING 2
Comparison of FFT,CWT,DWT

• The CWT and DWT values for stationary signals, are


approximate. But for many practical applications more than
very accurate frequency value the range of frequency is of
more importance.

• Between CWT and DWT, DWT is preferred because the


maximum coefficient cannot be determined very easily in the
CWT because the coefficient value gradually decreases and
only approximate value of scale can be determined.
38
DIGITAL IMAGE PROCESSING 2
Comparison of FFT,CWT,DWT

• The CWT and DWT values for stationary signals, are


approximate. But for many practical applications more than
very accurate frequency value the range of frequency is of
more importance.

• Between CWT and DWT, DWT is preferred because the


maximum coefficient cannot be determined very easily in the
CWT because the coefficient value gradually decreases and
only approximate value of scale can be determined.
39
DIGITAL IMAGE PROCESSING 2

U4 Lec 41: Wavelet Based Image


Processing

Dr. Shruthi M L J
Department of Electronics &
Communication Engineering

1
DIGITAL IMAGE PROCESSING 2
This Session

• Image Compression using DWT

4
DIGITAL IMAGE PROCESSING 2
DWT of an Image

Pyramidal structure when


DWT of an image is taken

5
DIGITAL IMAGE PROCESSING 2
DWT of an Image

Pyramidal structure when DWT of


an image is taken

Third Level
Decomposition

Second Level
Decomposition

First Level Decomposition


6
DIGITAL IMAGE PROCESSING 2
DWT of an Image

DC value

7
DIGITAL IMAGE PROCESSING 2
Wavelet Decomposition

Original Lena image Lena image after 1-level of wavelet decomposition

8
DIGITAL IMAGE PROCESSING 2
4 – level Wavelet Decomposition of Lena

9
DIGITAL IMAGE PROCESSING 2
DWT

• DWT Represents signal as sum of wavelet functions and scaling


function.

• Scaling function  Low frequencies: smooth parts

• Wavelet functions High frequencies: detailed parts

10
DIGITAL IMAGE PROCESSING 2
Applications of DWT

• Denoising (Nonlinear filtering & denoising)


• Compression of images
• Compression of video
• Watermarking of images
• Speech processing
• Biomedical signal processing
• Solution of partial differential equations
• Electromagnetic scattering
• Statistical estimation & detection
• Seismic & geographical signal processing
• Communication(modulation)
• Channel coding
• Edge detection & object isolation
• For sensing technologies (RF) 11
DIGITAL IMAGE PROCESSING 2
Block Transform/Wavelet based Coding

Block Transform Coding

Wavelet Coding System


12
DIGITAL IMAGE PROCESSING 2
Wavelet Coding: Compression using DWT

• The principal difference between the wavelet-based system


and the transform coding system is the omission of the
subimage processing stages of the transform coder

• Because wavelet transforms are both computationally efficient


and inherently local (i.e., their basis functions are limited in
duration), subdivision of the original image is unnecessary

13
DIGITAL IMAGE PROCESSING 2
Image Compression using DWT

Why DWT for Compression?

 Wavelets allow the transformation and compression of entire image


as a single block

• DWT allows uniform distribution of compression errors across the


entire image.

• Provides better quality than DCT, especially at higher compression


ratios

14
DIGITAL IMAGE PROCESSING 2
Image Compression using DWT

Disadvantage of DCT:
• Fixed block size: does not consider irregular shapes of real
images
• Introduces blocking artifacts at low bit rates

15
DIGITAL IMAGE PROCESSING 2
Image Compression using DWT

• Consider the block diagram of wavelet based coding:

• To encode a 2J × 2J image, an analyzing wavelet, , and minimum


decomposition level, J − P, are selected and used to compute the
discrete wavelet transform of the image.
• The computed transform converts a large portion of the original
image to horizontal, vertical, and diagonal decomposition
coefficients with zero mean and Laplacian-like probabilities.
16
DIGITAL IMAGE PROCESSING 2
Image Compression using DWT

• Because many of the computed coefficients carry little visual


information, they can be quantized and coded to minimize
intercoefficient and coding redundancy.
• Moreover, the quantization can be adapted to exploit any positional
correlation across the P decomposition levels
• One or more lossless coding methods, such as run-length, Huffman,
arithmetic, and bit-plane coding, can be incorporated into the final
symbol coding step.
• Decoding is accomplished by inverting the encoding operations,
with the exception of quantization, which cannot be reversed
exactly.

17
DIGITAL IMAGE PROCESSING 2
DWT of an Image

DC value

18
DIGITAL IMAGE PROCESSING 2
Wavelet Coding: Compression using DWT

• As with transform coding, wavelet coding is based on the


idea that the coefficients of a transform that decorrelates
the pixels of an image can be coded more efficiently than
the original pixels themselves.
• If the basis functions of the transform (in this case
wavelets) pack most of the important visual information
into a small number of coefficients, the remaining
coefficients can be quantized coarsely or truncated to zero
with little image distortion.
19
DIGITAL IMAGE PROCESSING 2
Selection of Wavelet

• The wavelets chosen as the basis of the forward and inverse


transforms affect all aspects of wavelet coding system design and
performance
• They impact directly the computational complexity of the transforms
and, less directly, the system’s ability to compress and reconstruct
images of acceptable error
• When the transforming wavelet has a companion scaling function,
the transformation can be implemented as a sequence of digital
filtering operations, with the number of filter taps equal to the
number of nonzero wavelet and scaling vector coefficients.
• The ability of the wavelet to pack information into a small number of
transform coefficients determines its compression and
reconstruction performance.
20
DIGITAL IMAGE PROCESSING 2
Selection of Wavelet

• The most widely used expansion functions for wavelet-based


compression are the Daubechies wavelets and biorthogonal
wavelets.
• The latter allow useful analysis properties, like the number of
vanishing moments to be incorporated into the decomposition
filters, while important synthesis properties, like smoothness
of reconstruction, are built into the reconstruction filters.

21
DIGITAL IMAGE PROCESSING 2
Selection of Wavelet

Three-scale wavelet transforms of Lena with


various wavelet functions:
Haar wavelets: the simplest and only discontinuous
wavelets
Daubechies wavelets: are among the most popular
imaging wavelets
Haar wavelets Daubechies wavelets Symlets: are an extension of the Daubechies
wavelets with increased symmetry
The Cohen-Daubechies-Feauveau wavelets: are
included to illustrate the capabilities of
biorthogonal wavelets

symlets 22
Cohen- Daubechies-Feauveau biorthogonal wavelets.
DIGITAL IMAGE PROCESSING 2
Performance Analysis of Wavelet basis Functions

Wavelet transform filter taps and zeroed coefficients


when truncating the transforms • The number of operations
in decomposed images below 1.5. involved in the computation
of the transforms increases
from 4 to 28 multiplications
and additions per coefficient
(for each decomposition
level)
• All four transforms were
computed using a fast wavelet
transform (i.e., filter bank)
formulation

23
DIGITAL IMAGE PROCESSING 2
Performance Analysis of Wavelet basis Functions

Wavelet transform filter taps and zeroed coefficients


when truncating the transforms • As the computational complexity
in decomposed images below 1.5. (i.e., the number of filter taps)
increases, the information packing
performance does as well.
• When Haar wavelets are employed
and the detail coefficients below
1.5 are truncated to zero, 33.8% of
the total transform is zeroed.
• With the more complex
biorthogonal wavelets, the number
of zeroed coefficients rises to
42.1%, increasing the potential
compression by almost 10%.

24
DIGITAL IMAGE PROCESSING 2

U4 Lec 42: Wavelet Based Image


Processing

Dr. Shruthi M L J
Department of Electronics &
Communication Engineering

1
DIGITAL IMAGE PROCESSING 2
This Session

• General aspects of wavelet based compression Cont..


• JPEG 2000 Compression technique

4
DIGITAL IMAGE PROCESSING 2
DWT

• DWT Represents signal as sum of wavelet functions and scaling


function.

• Scaling function  Low frequencies: smooth parts

• Wavelet functions High frequencies: detailed parts

5
DIGITAL IMAGE PROCESSING 2
Image Compression using DWT

The block diagram of wavelet based coding:

6
DIGITAL IMAGE PROCESSING 2
Wavelet Coding: Compression using DWT

• The principal difference between the wavelet-based system


and the transform coding system is the omission of the
subimage processing stages of the transform coder

• Because wavelet transforms are both computationally efficient


and inherently local (i.e., their basis functions are limited in
duration), subdivision of the original image is unnecessary

7
DIGITAL IMAGE PROCESSING 2
Selection of Wavelet

• Three aspects to be considered:

• Computational complexity of the transforms


• Number of filter taps equal to the number of nonzero wavelet
and scaling vector coefficients.
• The ability of the wavelet to pack information into a small
number of transform coefficients determines its compression
and reconstruction performance.

8
DIGITAL IMAGE PROCESSING 2
Decomposition Level Selection

• Another factor affecting wavelet coding computational complexity and

reconstruction error is the number of transform decomposition levels.

• Because a P-scale fast wavelet transform involves P filter bank iterations,

the number of operations in the computation of the forward and inverse

transforms increases with the number of decomposition levels.

9
DIGITAL IMAGE PROCESSING 2
Decomposition Level Selection

• Moreover, quantizing the increasingly lower-scale coefficients


that result with more decomposition levels affects increasingly
larger areas of the reconstructed image.

• In many applications, like searching image data- bases or


transmitting images for progressive reconstruction, the
resolution of the stored or transmitted images, and the scale of
the lowest useful approximations, normally determine the
number of transform levels
10
DIGITAL IMAGE PROCESSING 2
Decomposition Level Selection

• The table lists both the percentage of


zeroed coefficients and the resulting rms
reconstruction errors.
• Note that the initial decompositions are
responsible for the majority of the data
compression.
Decomposition level impact on wavelet coding • There is little change in the number of
the 512 x 512 image of Lena truncated coefficients above three
decomposition levels.
The effect of decomposition level selection on the coding of
Lena using biorthogonal wavelets and a fixed global
threshold of 25.
As in the previous wavelet coding example, only detail
coefficients are truncated.
11
DIGITAL IMAGE PROCESSING 2
Quantizer Design

• The most important factor affecting wavelet coding compression and


reconstruction error is coefficient quantization
• Although the most widely used quantizers are uniform, the effectiveness
of the quantization can be improved significantly by
(1) introducing a larger quantization interval around zero, called a dead
zone, or
(2) adapting the size of the quantization interval from scale to scale.
• In either case, the selected quantization intervals must be transmitted to
the decoder with the encoded image bit stream.
12
DIGITAL IMAGE PROCESSING 2
Quantizer Design

• The intervals themselves may be determined heuristically, or


computed automatically based on the image being
compressed
• For example, a global coefficient threshold could be computed
as the median of the absolute values of the first-level detail
coefficients or as a function of the number of zeroes that are
truncated and the amount of energy that is retained in the
reconstructed image.

13
DIGITAL IMAGE PROCESSING 2
Quantizer Design

• The impact of dead zone interval size on the


percentage of truncated detail coefficients
for a three-scale biorthogonal wavelet-based
encoding
• As the size of the dead zone increases, the
number of truncated coefficients does as
well. Above the knee of the curve (i.e.,
beyond 5) there is little gain.
• This is due to the fact that the histogram of
the detail coefficients is highly peaked
around zero.
The impact of dead zone interval selection on wavelet coding
14
DIGITAL IMAGE PROCESSING 2
Quantizer Design

• The rms reconstruction errors corresponding to


the dead zone thresholds in figure increase from
0 to 1.94 intensity levels at a threshold of 5, and
to 3.83 intensity levels for a threshold of 18,
where the number of zeroes reaches 93.85%.
• If every detail coefficient were eliminated, that
percentage would increase to about 97.92% (by
The impact of dead zone interval selection on about 4%), but the reconstruction error would
wavelet coding
grow to 12.3 intensity levels. 15
DIGITAL IMAGE PROCESSING 2
Existing Image Compression algorithms

Number of wavelet based algorithms have been proposed since 1993 to


2000
• Embedded Zero tree Wavelet (EZW) (1993)
• Set Partitioning in Hierarchical Trees (SPIHT) (1996)
• Space –Frequency Quantization (SFQ) (1997)
• Compression with Reversible Embedded Wavelet (CREW) (1997)
• Embedded Predictive Wavelet Image Coder (EPWIC) (1997)
• Wavelet Difference Reduction (WDR) (1998)
• Set Partitioned Embedded bloCK coder (SPECK) (1999)
• Embedded Block Coding with Optimized Truncation (EBCOT) (2000)
• Adaptively Scanned Wavelet Difference Reduction (ASWDR) (2000)

16
DIGITAL IMAGE PROCESSING 2
Compression Standards

• JPEG compression standard based on DCT (1992)


• Simplicity, satisfactory performance and availability of special hardware for
implementation
• Drawbacks:
The most significant drawback is the blocking artifacts in the reconstructed
image at low bit rates
• This problem was tackled by Lapped Orthogonal Transform (LOT) by using
smoothly overlapping blocks. Although blocking effects are reduced in LOT
compressed images, increased computational complexity of such algorithms
does not justify wide replacement of DCT by LOT.
• Some more transforms like Modified DCT and some fast implementations of
DCT exist in literature but do not solve the problem fully.
• Another standard, JPEG 2000 was developed with many additional
features.
• This standard uses DWT for image compression.
17
DIGITAL IMAGE PROCESSING 2
JPEG 2000

• JPEG-2000 extends the popular JPEG standard(uses DCT) to provide


increased flexibility in both the compression of continuous-tone still
images and access to the compressed data

• Portions of a JPEG-2000 compressed image can be extracted for


retransmission, storage, display, and/or editing

• The standard is based on the wavelet coding techniques

• Coefficient quantization is adapted to individual scales and subbands,


and the quantized coefficients are arithmetically coded on a bit-plane
basis 18
DIGITAL IMAGE PROCESSING 2
JPEG 2000 Algorithm

Steps of encoding process:


1. DC level shift the samples of the Ssiz- bit unsigned image to be coded by
subtracting 2Ssiz−1 (For an 8-bit image subtract 128)

(Ssiz is used in the standard to denote intensity resolution)

• If the image has more than one component, such as the red, green, and
blue planes of a color image, each component is shifted individually.

• If there are exactly three components, they may be optionally


decorrelated using a reversible or nonreversible linear combination of the
components 19
DIGITAL IMAGE PROCESSING 2
JPEG 2000 Algorithm

Steps of encoding process:


2. After the image has been level-shifted and optionally decorrelated, its
components can be divided into tiles

(Tiles are rectangular arrays of pixels that are processed independently)

Each tile component can be reconstructed independently, providing a


simple mechanism for accessing and/or manipulating a limited region of a
coded image.

20
DIGITAL IMAGE PROCESSING 2
JPEG 2000 Algorithm

Steps of encoding process:


3. The 1-D discrete wavelet transform of the rows
and columns of each tile component is then
computed.
• For error-free compression, the transform is
based on a biorthogonal, 5/3 coefficient
scaling and wavelet vector (Le Gall and
Tabatabai [1988]).
• A rounding procedure is defined for non-
integer-valued transform coefficients. In lossy
applications, a 9/7 coefficient scaling-wavelet
vector is employed(Antonini, Barlaud,
Mathieu, and Daubechies [1992])
21
DIGITAL IMAGE PROCESSING 2
JPEG 2000 Algorithm

Steps of encoding process:


3. The 1-D discrete wavelet transform of the rows and columns of
each tile component computed

JPEG 2000 two- scale wavelet


transform tile- component coefficient
notation and analysis gain

22
DIGITAL IMAGE PROCESSING 2
JPEG 2000 Algorithm

Steps of encoding process:


3. The transformation just described produces four subbands;
• a low-resolution approximation of the tile component and the
component’s horizontal, vertical, and diagonal frequency characteristics.
• Repeating the transformation NL times, with subsequent iterations
restricted to the previous decomposition’s approximation coefficients,
produces an NL-scale wavelet transform.
• Adjacent scales are related spatially by powers of 2, and the lowest scale
contains the only explicitly defined approximation of the original tile
component.

23
DIGITAL IMAGE PROCESSING 2
JPEG 2000 Algorithm

Steps of encoding process:


3. Consider the following figure, where the notation of the JPEG-2000
standard is summarized for the case of NL = 2, a general NL-scale
transform contains 3NL + 1 subbands whose coefficients are denoted ab
for b = NL HL,..., 1HL, 1LH, 1HH. The standard does not specify the
number of scales to be computed.
• When each of the tile components has been processed, the total number
of transform coefficients is equal to the number of samples in the original
image, but the important visual information is concentrated in a few
coefficients.
• To reduce the number of bits needed to represent the transform,
coefficient ab (u, v) of subband b is quantized to value qb (u, v)

24
DIGITAL IMAGE PROCESSING 2
JPEG 2000 Algorithm

Steps of encoding process:


4. In the final steps of the encoding process, the coefficients of each
transformed tile-component’s subbands are arranged into rectangular
blocks called code blocks, which are coded individually, one bit plane at
a time.
• Starting from the most significant bit plane with a nonzero element, each bit plane
is processed in three passes.
• Each bit (in a bit plane) is coded in only one of the three passes, which are called
significance propagation, magnitude refinement, and cleanup.
• The outputs are then arithmetically coded and grouped with similar passes from
other code blocks to form layers (A layer is an arbitrary number of groupings of
coding passes from each code block)
• The resulting layers finally are partitioned into packets, providing an additional
method of extracting a spatial region of interest from the total code stream. Packets
are the fundamental unit of the encoded code stream.
25
DIGITAL IMAGE PROCESSING 2
JPEG 2000 Algorithm

Steps of Decoding process:


• JPEG-2000 decoders simply invert the operations of encoder
• After reconstructing the subbands of the tile-components from the
arithmetically coded JPEG-2000 packets, a user-selected number of the
subbands is decoded.
• Although the encoder may have encoded Mb bit planes for a particular
subband, the user, due to the embedded nature of the code stream, may
choose to decode only Nb bit planes.
• This amounts to quantizing the coefficients of the code block

26
DIGITAL IMAGE PROCESSING 2
JPEG 2000 Algorithm
Consider 4 JPEG-2000 approximations of Lena.
Each row contains a result after compression and reconstruction, the scaled difference between the
result and the original image, and a zoomed portion of the reconstructed image.

level of compression, C = 25 level of compression, C = 75

level of compression, C = 52 level of compression, C = 105 27


DIGITAL IMAGE PROCESSING 2
Comparision of JPEG (DCT Based) and JPEG 2000 Algorithm

level of compression, C = 25 level of compression, C = 25

level of compression, C = 52
level of compression, C = 52

Results of JPEG Compression Results of JPEG 2000 Compression 28


DIGITAL IMAGE PROCESSING 2
Comparision of JPEG (DCT Based) and JPEG 2000 Algorithm
• A visual comparison of the error images in JPEG with the corresponding
images JPEG 2000 reveals a noticeable decrease of error in the JPEG-2000
results—3.86 and 5.77 intensity levels, as opposed to 5.4 and 10.7
intensity levels for the JPEG results.
• The computed errors favor the wavelet-based results at both compression
levels.
• Besides decreasing reconstruction error, wavelet coding dramatically
increases (in a subjective sense) image quality. Note that the blocking arti-
fact that dominated the JPEG results is not present JPE 2000.
• Finally, we note that the high compression achieved (C= 52 and C=105) is
not practical with JPEG. JPEG-2000 provides useable images that are
compressed by more than 100:1, with the most objectionable
degradation being increased image blur.

29
THANK YOU

Dr. Shruthi M L J
Department of Electronics &
Communication Engineering

shruthimlj@pes.edu
+91 8147883012

31

You might also like