1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng Chapter 15: Wavelets
2 © 2010 Cengage Learning Engineering. All Rights Reserved Waves and Wavelets The idea of wavelets is to keep the wave concept, but drop the periodicity We may consider a wavelet to be a little part of a wave, a wave that is only nonzero in small region Ch15-p.429
3 © 2010 Cengage Learning Engineering. All Rights Reserved Waves and Wavelets Suppose we are given a wavelet Dilate it by applying a scaling factor to x: f (2x) would “squash” the wavelet, and f (x/2) would expand it Translate it by adding or subtracting an appropriate value from x: f (x − 2) would shift the wavelet 2 to the right; f (x + 3) would shift the wavelet 3 to the left Change its height by simply multiplying the function by a constant Ch15-p.429
4 FIGURE 15.2 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch15-p.431
5 FIGURE 15.2 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch15-p.431
Waves and Wavelets © 2010 Cengage Learning Engineering. All Rights Reserved A simple Wavelet Transform Wavelet transforms work by taking weighted averages of input values and providing any other necessary information to be able to recover the original input Averaging of two values and differencing Ch15-p.432
Waves and Wavelets © 2010 Cengage Learning Engineering. All Rights Reserved. suppose we are given two numbers, 14 and 22. We can easily create their average To recover the original two values from their average, we need a second value, the difference, obtained by subtracting the average from the first value: Ch15-p.432
Waves and Wavelets © 2010 Cengage Learning Engineering. All Rights Reserved. e.g. The concatenation of v 1 and v 2 is the Discrete wavelet transform at 1 scale of the original vector Ch15-p.433
Waves and Wavelets © 2010 Cengage Learning Engineering. All Rights Reserved. Discrete wavelet transform at 2 scales Discrete wavelet transform at 3 scales Ch15-p.433
Waves and Wavelets © 2010 Cengage Learning Engineering. All Rights Reserved. To recover the original vector At each stage, the averaging vector produces a lower-resolution version of the original vector Ch15-p.434
Waves and Wavelets © 2010 Cengage Learning Engineering. All Rights Reserved. Wavelet transforms produce a mix of lower resolutions of the input and the extra information required for inversion We notice that the differences may be small if the input values are close together. This concept leads to an idea for compression We apply a threshold by setting to zero all values in the transform that are less than a predetermined value Ch15-p.434
12 Threshold d 3 with 0 Use d’ 3 to recover the original vector 15.1 Waves and Wavelets © 2010 Cengage Learning Engineering. All Rights Reserved. Ch15-p.434
A simple Wavelet: The Haar Wavelet © 2010 Cengage Learning Engineering. All Rights Reserved. The Haar wavelet is defined by the function Ch15-p.434
A simple Wavelet: The Haar Wavelet © 2010 Cengage Learning Engineering. All Rights Reserved Applying the Haar Wavelet where the subscripts on φ(x) and ψ(x) represent different dilations and shifts of the basic functions. Then, we can recover f ( x ) with Ch15-p.435
A simple Wavelet: The Haar Wavelet © 2010 Cengage Learning Engineering. All Rights Reserved. The form of the equations above indicates that the discrete wavelet transform can be written as a matrix multiplication, as we saw for the DFT We will show below how this is done. Notice that the Haar wavelet can be written in terms of the simpler pulse function: Mother wavelet father wavelet Ch15-p.435
A simple Wavelet: The Haar Wavelet © 2010 Cengage Learning Engineering. All Rights Reserved. Dilation equation h i are called the filter coefficients (taps) Ch15-p.436
A simple Wavelet: The Haar Wavelet © 2010 Cengage Learning Engineering. All Rights Reserved. Ch15-p.437
A simple Wavelet: The Haar Wavelet © 2010 Cengage Learning Engineering. All Rights Reserved. Ch15-p.437
19 © 2010 Cengage Learning Engineering. All Rights Reserved. The averaging part of the wavelet corresponds to low-pass filtering, in that we are coarsening or blurring our input Similarly, the differencing part of the transform corresponds to a high-pass filter Thus, a wavelet transform contains within it both high- and low-pass filtering of our input, and we can consider a wavelet transform entirely in terms of filters Ch15-p A simple Wavelet: The Haar Wavelet
20 © 2010 Cengage Learning Engineering. All Rights Reserved Two-Dimensional Wavelets standard decomposition Ch15-p.438
A simple Wavelet: The Haar Wavelet © 2010 Cengage Learning Engineering. All Rights Reserved. nonstandard decomposition Ch15-p.439
Wavelets in M ATLAB © 2010 Cengage Learning Engineering. All Rights Reserved. We will use the UviWave toolbox, developed at the University of Vigo in Spain. Its homepage is ∼ wavelets/uvi_wave.html It can also be found at other places on the Web Assuming that you have downloaded and installed the toolbox Ch15-p.439
Wavelets in M ATLAB © 2010 Cengage Learning Engineering. All Rights Reserved. Here h and g are the low-pass and high-pass filter coefficients for the forward transform rh and rg are the low-pass and high-pass filter coefficients for the inverse transform The daub function produces the filter coefficients for a class of wavelets called Daubechies wavelets, of which the Haar wavelet is the simplest Ch15-p.439
Wavelets in M ATLAB © 2010 Cengage Learning Engineering. All Rights Reserved. Ch15-p.440
Wavelets in M ATLAB © 2010 Cengage Learning Engineering. All Rights Reserved. Ch15-p.440
Wavelets in M ATLAB © 2010 Cengage Learning Engineering. All Rights Reserved. Ch15-p.441
27 FIGURE 15.6 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch15-p.441
28 FIGURE 15.7 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch15-p.442
The Daubechies Wavelets © 2010 Cengage Learning Engineering. All Rights Reserved. Ch15-p.442
30 As for the Haar wavelet, we can apply the Daubechies 4 wavelet by a matrix multiplication; the matrix for a one-scale DWT on a vector of length 8 is 15.4 The Daubechies Wavelets © 2010 Cengage Learning Engineering. All Rights Reserved. Ch15-p.443
The Daubechies Wavelets © 2010 Cengage Learning Engineering. All Rights Reserved. Notice that the filter coefficients overlap between rows, which is not the case for the Haar matrix This means that the use of the Daubechies 4 wavelet will have smoother results than using the Haar wavelet Ch15-p.443
The Daubechies Wavelets © 2010 Cengage Learning Engineering. All Rights Reserved. Steps for performing a one-scale wavelet transform are given by Umbaugh [37]: 1.Convolve the image rows with the low-pass filter 2.Convolve the columns of the result of Step 1 with the low- pass filter and rescale this to half its size by subsampling 3.Convolve the result of Step 1 with the high-pass filter and again subsample to obtain an image of half the size 4.Convolve the original image rows with the high-pass filter Ch15-p.444
The Daubechies Wavelets © 2010 Cengage Learning Engineering. All Rights Reserved. 5.Convolve the columns of the result of Step 4 with the low- pass filter and rescale this to half its size by subsampling 6.Convolve the result of Step 4 with the high-pass filter and again subsample to obtain an image of half the size At the end of these steps there are four images, each half the size of the original Ch15-p.444
34 FIGURE 15.8 © 2010 Cengage Learning Engineering. All Rights Reserved. 1.the low-pass/low-pass image (LL), the result of Step 2, 2.the low-pass/high-pass image (LH), the result of Step 3, 3.the high-pass/low-pass image (HL), the result of Step 5, and 4.the high-pass/high-pass image (HH), the result of Step 6 Ch15-p.444
The Daubechies Wavelets © 2010 Cengage Learning Engineering. All Rights Reserved. The filter coefficients of a wavelet are such that the transform may be inverted precisely to recover the original image Using filters, this is done by taking each subimage, zero interleaving to produce an image of double the size and convolving with the inverse low-pass and high-pass filters Finally, the results of all the filterings are added. For the Daubechies 4 wavelet, the inverse low-pass and high-pass filters are Ch15-p.444
The Daubechies Wavelets © 2010 Cengage Learning Engineering. All Rights Reserved. A generalization to filtering: lifting Ch15-p.445 (Haar wavelet)
The Daubechies Wavelets © 2010 Cengage Learning Engineering. All Rights Reserved. A lifting scheme for the Daubechies 4 wavelet is Ch15-p.445
38 FIGURE 15.9 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch15-p.446
39 FIGURE © 2010 Cengage Learning Engineering. All Rights Reserved. Ch15-p.446
Image Compression Using Wavelets © 2010 Cengage Learning Engineering. All Rights Reserved Thresholding and Quantization Ch15-p.447
41 FIGURE © 2010 Cengage Learning Engineering. All Rights Reserved. Ch15-p.448
42 FIGURE © 2010 Cengage Learning Engineering. All Rights Reserved. Ch15-p.448
Image Compression Using Wavelets © 2010 Cengage Learning Engineering. All Rights Reserved. Ch15-p.449
44 FIGURE © 2010 Cengage Learning Engineering. All Rights Reserved. Ch15-p.449
45 FIGURE © 2010 Cengage Learning Engineering. All Rights Reserved. Ch15-p.450
46 FIGURE © 2010 Cengage Learning Engineering. All Rights Reserved. Ch15-p.450
Image Compression Using Wavelets © 2010 Cengage Learning Engineering. All Rights Reserved Extraction Ch15-p.451
48 FIGURE © 2010 Cengage Learning Engineering. All Rights Reserved. Ch15-p.452
High-Pass Filtering Using Wavelets © 2010 Cengage Learning Engineering. All Rights Reserved. Ch15-p.452
50 FIGURE © 2010 Cengage Learning Engineering. All Rights Reserved. Ch15-p.453
Denising Using Wavelets © 2010 Cengage Learning Engineering. All Rights Reserved. Ch15-p.453
52 FIGURE © 2010 Cengage Learning Engineering. All Rights Reserved. Ch15-p.454
53 FIGURE © 2010 Cengage Learning Engineering. All Rights Reserved. Ch15-p.454