Top Banner
Lecture05 Lecture05 Transform Coding Transform Coding
18
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Inverse Dwt

Lecture05Lecture05

Transform CodingTransform Coding

Page 2: Inverse Dwt

Typical image compression steps

Transform Coding to de-correlate the signal using a signal transform such as• Discrete Cosine Transform (DCT).• Discrete wavelet Transform (DWT).

Quantization: This is where the information loss occurs.

Entropy coding (lossless compression). Thus lossless compression is part of lossy compression.

Page 3: Inverse Dwt

Wavelet Transform - exampleWavelet Transform - example

Page 4: Inverse Dwt

Wavelet-Based Coding There are two types of wavelet transforms (WT): the

continuous wavelet transform (CWT) and the discrete wavelet transform (DWT). We will not discuss CWT but we will discuss DWT.

The recently developed JPEG2000 standard is based on DWT while the first JPEG standard is based on DCT.

The wavelet transform can be used to create smaller and smaller summary images, thus resulting in a Multi-resolution Analysis (MRA).

When we map a signal from time-domain to frequency-domain, say using Discrete Fourier Transform (DFT), a closely resembled counterpart of DCT, a localization in time results in a spread in frequency and a localization in frequency results in a spread in time, thus resulting in a bad compromise in time-frequency resolution. The wavelet transform represents a signal with a good resolution in both time and frequency.

Page 5: Inverse Dwt

Haar-Wavelet Transform This is the simplest wavelet transform. We will

explain it using the following example:

Consider the transform that replaces the original sequence with its pair wise average xn−1,i and difference dn−1,i defined as follows:

The above two equations implements the Forward Discrete Wavelet Transform ( or just Discrete Wavelet Transform (DWT) of the Haar-wavelet transform.

}15,7,21,29,26,25,13,10{, inx

2212,2,

,112,2,

,1

inin

ininin

in

xxd

xxx

Page 6: Inverse Dwt

Haar-Wavelet Transform

The averages and differences are applied only on consecutive pairs of input sequences whose first element has an even index. Therefore, the number of elements in each set {xn−1,i} and {dn−1,i} is exactly half of the number of elements in the original sequence.

Form a new sequence having length equal to that of the original sequence by concatenating the two sequences {xn−1,i} and {dn−1,i}. The resulting sequence is

}4,4,5.0,5.1,11,25,5.25,5.11{},{ ,1,1 inin dx

Page 7: Inverse Dwt

Haar-Wavelet Transform This sequence has exactly the same number of elements as

the input sequence - the transform did not increase the amount of data.

Since the first half of the above sequence contain averages from the original sequence, we can view it as a coarser approximation to the original signal. The second half of this sequence can be viewed as the details or approximation errors of the first half.

It is easily verified that the original sequence can be reconstructed from the transformed sequence using the relations

The above two equations implements the Inverse Discrete Wavelet Transform (IDWT) of the Haar-wavelet transform.

inininininin dxxdxx ,1,112,,1,12,

Page 8: Inverse Dwt

Scaling function and wavelet Scaling function and wavelet functionfunction

Averaging and differencing can be carried out by applying a so-called scaling function and wavelet function along the signal. (a) scaling function. (b) wavelet function

Page 9: Inverse Dwt

2D Haar-wavelet transform Extending the one-dimensional Haar-wavelet transform into

two dimensions is relatively easy: we simply apply the one-dimensional transform to the rows and columns of the two dimensional input separately, thus resulting in a separable 2D wavelet transform. Input image for the 2D Haar Wavelet Transform. (a) The pixel values. (b) Shown as an 8X8 image.

Page 10: Inverse Dwt

2D Haar-wavelet transformImmediate output of the 2D Haar Wavelet Transform: After applying haar-wavelet transformalong the rows.

First level output of the 2D Haar Wavelet Transform: After applying haar-wavelet transformalong the rows and columns.

Page 11: Inverse Dwt

Filter Banks DWT is usually represented using what is known

as filter banks. The forward wavelet transform involves two

filters, one corresponding to the summary known as scaling filter or low-pass filter, other corresponding to detail known as wavelet filter or high pass filter. Also note that low-pass filter leads to the scaling function and the high-pass filter leads to wavelet function under certain conditions. Thus not all kind of filters leads to wavelet transforms.

In the forward discrete wavelet transform resulting in the forward filter bank ( a.k.a analysis filter bank), we need to sub-sample, i.e. remove every other value, the filtered signal by a factor 2. Thus, in obtaining a particular summary, say, we need to do two operations: a filtering operation and a sub-sampling operation.

Page 12: Inverse Dwt

ConvolutionConvolution

By definition, a filtering operation is a convolution operation. The convolution of two discrete sequences, f(n) and h(n), is given by

k

knhkfnhfng )()()(*)(

Page 13: Inverse Dwt

The forward discrete wavelet transform

The forward discrete wavelet transform is graphically represented as follows:

where the top-branch results in the summary and the lower-branch results in the detail, h0 is the low-pass filter and h1 is the high-pass filter. These branches are also known as sub-bands. Thus the low-pass sub-band perform low pass filtering (convolution with the low pass filter) and then sub-sample by two.

Page 14: Inverse Dwt

The forward discrete wavelet transform

The inverse discrete wavelet transform is graphically represented as follows:

where h0 is the low-pass filter and h1 is the high-pass filter. Note that before we apply the inverse filtering operation we need to up-sample the input, i.e. place a zero after every value. The top-branch takes the summary signal while the lower-branch takes the detail signal. This inverse filter bank is also known as the synthesis filter bank.

Page 15: Inverse Dwt

A three level 1D wavelet transform and its inverse

Page 16: Inverse Dwt

Forward wavelet transform – Forward wavelet transform – formulasformulas

Let cj be the scaling coefficients at level j, cj is the next coarser level of cj+1, and dj be the detail coefficients at level j. Then we have the following formulas• Analysis from fine scale to coarse scale:

mjj

mjj

mckmhkd

mckmhkc

)()2()(

)()2()(

11

10

Page 17: Inverse Dwt

Inverse wavelet transform – Inverse wavelet transform – formulasformulas

Synthesis from coarse scale to fine scale:

m

jm

jj mkhmdmkhmckc )2()()2()()( 101

Page 18: Inverse Dwt

Boundary ConditionsBoundary Conditions

Practical signals (images) are usually Practical signals (images) are usually finite. This lead to complications at finite. This lead to complications at the boundaries.the boundaries.• Assume that the signal is periodicAssume that the signal is periodic

In the case of images assume that the In the case of images assume that the image gets repeated across horizontal and image gets repeated across horizontal and vertical dimensions.vertical dimensions.