210 likes | 550 Views
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.
E N D
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-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.
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.
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
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.
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 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.
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.
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.
Convolution • By definition, a filtering operation is a convolution operation. The convolution of two discrete sequences, f(n) and h(n), is given by
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.
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.
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:
Inverse wavelet transform – formulas • Synthesis from coarse scale to fine scale:
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.