Sunteți pe pagina 1din 18

Lecture05

Transform Coding

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.

Wavelet Transform - example

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 Multiresolution Analysis (MRA). When we map a signal from time-domain to frequencydomain, 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.

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 xn1,i and difference dn1,i defined as follows:

xn,i {10,13,25,26,29,21,7,15}
xn, 2i xn, 2i 1 2 d n1,i

xn1,i

xn, 2i xn, 2i 1 2

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

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 {xn1,i} and {dn1,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 {xn1,i} and {dn1,i}. The resulting sequence is

{xn1,i , d n1,i } {11.5,25.5,25,11,1.5,0.5,4,4}

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

xn, 2i xn1,i d n1,i

xn, 2i 1 xn1,i d n1,i

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

Scaling function and wavelet function

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

2D Haar-wavelet transform

Extending the one-dimensional Haar-wavelet transform into two dimensions is relatively easy: we simply apply the onedimensional 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.

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

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.

Filter Banks

Convolution

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

g ( n) f * h( n) f ( k ) h( n k )
k

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 subsample by two.

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.

A three level 1D wavelet transform and its inverse

Forward wavelet transform formulas

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:

c j (k ) h0 (m 2k )c j 1 (m) d j (k ) h1 (m 2k )c j 1 (m)
m m

Inverse wavelet transform formulas

Synthesis from coarse scale to fine scale:

c j 1 (k ) c j (m)h0 (k 2m) d j (m)h1 (k 2m)


m m

Boundary Conditions

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

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

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