P. 1
12-Unit12

12-Unit12

|Views: 1|Likes:
Published by Aryan Singh Chouhan

More info:

Published by: Aryan Singh Chouhan on Jul 11, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

07/11/2012

pdf

text

original

Digital Image Processing

Unit 12

Unit 12

Wavelets and Multi Resolution Processing

Structure 12.1 Introduction Objectives 12.2 Image Pyramids 12.3 Series Expansion Windowed Fourier transform 12.4 Scaling functions - Continuous Wavelet Transform 12.5 Haar transform 12.6 Subband coding 12.7 Wavelet functions 12.8 Discrete Wavelet transform in one dimension 12.9 Wavelet transforms in two dimensions Standard decomposition Non-Standard decomposition 12.10 Multiresolution processing and wavelets 12.11 Summary 12.12 Terminal questions 12.13 Answers

12.1 Introduction
The main objective of the course is to provide enough background on wavelets so that a researcher or skilled practitioner in computer graphics can understand the nature and properties of wavelets, and assess their suitability to solve specific problems in computer graphics. Our goal is that after the course and/or the study of these notes one should be able to access the basic mathematical literature on wavelets, understand and review critically the current computer graphics literature using them, and have some intuition about the pluses and minuses of wavelets and wavelet transform for a specific application.

Sikkim Manipal University

Page No. 194

Digital Image Processing

Unit 12

Objectives By the end of this unit you will understand: Image pyramids, Subband coding Haar transform Discrete wavelet transforms Methods for wavelet transforms in 2D Multiresolution and wavelets

12.2 Image Pyramids
Analyzing, manipulating and generating data at various scales should be a familiar concept to anybody involved in Computer Graphics. We will start with “image” pyramids. In pyramids such as a MIP map used for filtering, successive averages are built from the initial signal. Fig. 12.1 shows a schematic representation of the operations and the results.

Figure 12.1: Mean pyramid

It is clear that it can be seen as the result of applying box filters scaled and translated over the signal. For initial values we have log 2 (n) terms in the result. Moreover because of the order we have chosen for the operations we only had to compute n = 1 additions (and shifts if means are stored instead of sums). This is not a good scheme for reconstruction, since all we need is the last row of values to reconstruct the signal (of course they are sufficient since they are the initial values, but they are also necessary since only a sum of adjacent values is available from the levels above). We can observe, though, that there is some redundancy in the data. Calling si;j the jth element of level i (0 being the top of the pyramid, k = log2(n) being the bottom level) we have:
Sikkim Manipal University Page No. 195

12. the computational scheme becomes as shown in Fig. but at the level below we store: It is clear that by adding s0.0 we retrieve s1. 12.0 and s0 1. Figure 12.3.2: Building the pyramid with differences Sikkim Manipal University Page No. We therefore have the same information with one less element.2. The price we have to pay is that now to effect a reconstruction we have to start at the top of the pyramid and stop at the level desired.1.0 as before. 196 . Since we need the top value as well (s0.0 and by subtracting s0.Digital Image Processing Unit 12 We can instead store s0.0). The computational scheme for the reconstruction is given in Fig.0 we retrieve s1.0 and s0 1. The same modification applied recursively through the pyramid results in n = 1 values being stored in k = 1 levels. and the sums as intermediary results.

we can see easily that the successive filters in the difference pyramid are (1/2. In the following examples we will use for simplicity and clarity piece-wise constant signals and piece-wise constant basis functions to show the characteristics of several transforms and encoding schemes. 12. Sikkim Manipal University Page No. the other with a (small) range of scales in constant spans. but a vague concept is sufficient here) with time (or through space for images). 197 .5. one with a single step.3 Series Expansion The standard Fourier transform is especially useful for stationary signals.4 and Fig. 12. 1/2) and (1/2. their scales and translates. Notice also that this scheme computes the pyramid in O(n) operations.3: Reconstructing the signal from difference pyramid If we look at the operations as applying a filter to the signal. The signals are shown in Fig. 12. -1/2). For signals such as images with sharp edges and other discontinuities. however. We will see that they are characteristics of the Haar transform. but are added everywhere.Digital Image Processing Unit 12 Figure 12. one problem with Fourier transform and Fourier synthesis is that in order to accommodate a discontinuity high frequency terms appear and they are not localized. that is for signals whose properties do not change much (stationarity can be defined more precisely for stochastic processes. Two sample 1-D signals will be used.

Figure 12. There are various definitions for them. A simple recursive one is: Sikkim Manipal University Page No. The first 8 basis functions of the Walsh transform Wi(t) are as shown in Fig.4: Piece-wise constant 1-D signal (signal 1) Figure 12. but with piecewise constant bases is the Walsh transform.6.5: Piece-wise constant 1-D signal (signal 2) A transform similar in properties to the Fourier transform.6: First 8 Walsh bases The Walsh functions are normally defined for and are always 0 outside of this interval (so what is plotted in the preceding figure is actually They have various ordering for their index i. 12.Digital Image Processing Unit 12 Figure 12. so always make sure you know which ordering is used when dealing with W i (t). The most common. 198 . used here. is where i is equal to the number of zero crossings of the function (the so-called sequency order).

7 and Fig. Note that since the original signals have discontinuities only at integral values. as well as would be the Sikkim Manipal University Page No. But we should also note that in this example. 12. 199 .Digital Image Processing Unit 12 with W 0 (t) = 1. where j ranges from 0 to1and q = 0 or 1.7: Walsh coefficients for signal 1. the signals are exactly represented by the first 32 Walsh bases at most.8 show the coefficients of the Walsh basis for both of the above signals. Figure 12. The Walsh transform is a series of coefficients given by: and the function can be reconstructed as: Fig.8: Walsh coefficients for signal 2. 12. Figure 12.

Of course we got a two-variable function as an answer. can be defined as: The spread in time is given by: Sikkim Manipal University Page No. Another is that it is not possible to get high accuracy in both the position (in time) and frequency of a contributing discontinuity. but we have also acquired some new problems. It is clear that the filter function w (t) allows us a window on the frequency spectrum of f (t) around . being the additional variable. the presence of a single discontinuity at 21 for signal 1 introduces the highest “frequency” basis.3. An alternate view is to see the filter impulse response modulated to the frequency being applied to the Fourier transform of the signal f(t) “for all times” (this is known in signal processing as a modulated filter bank). or spread in frequency. with _. of the window w (t). The bandwidth. inherent to the technique. Given a window function w (t) (we require that the function has a finite integral and is non-zero over a finite interval) we define the windowed Fourier transform of the signal f (t) as: In words. and it has to be added globally for all t. is the fact we have one more variable. In general cases the coefficients for each basis function decrease rapidly as the order increases. the position at which the filter is applied. One. with W (f) its Fourier transform. 200 .1 Windowed Fourier transform One way to localize the high frequencies while preserving the linearity of the operator is to use a windowed Fourier transform (WFT ) also known as a short-time Fourier transform (STFT ). 12. the transform is the Fourier transform of the signal with the filter applied.Digital Image Processing Unit 12 case for a Fourier transform. We have acquired the ability to localize the frequencies. and that usually allows for a simplification (or compression) of the representation of the original signal by dropping the basis functions whose coefficients are small (obviously with loss of information if the coefficients are not 0).

9 and 12. In fact there is an equality. ************************************************************************************** If we have a signal consisting of two δ pulses in time. To illustrate with a piece-wise constant transform. they cannot be discriminated by a WFT using this w (t) if they are Δ t apart or less. The box is defined as: This box has a width of 4. the resolution limit is the same over all times and frequencies. ************************************************************************************** Exercise 1: Compute Δ f and Δ t for the box filter as a function of A and T0.Digital Image Processing Unit 12 By Parseval’s theorem both denominators are equal. 201 . but unfortunately they are not independent. Similarly two pure sine waves (δ pulses in frequency) cannot be discriminated if they are Δ f apart or less. the Heisenberg inequality that bounds their product: The lower bound is achieved by the Gaussian. It is important to note the Δ f for this window is infinite in the measure given above. and they are filled in black for a positive value and lighter grey for a negative value. This means that there is no adaptability of the analysis. and similarly for time. In both cases these values represent the root mean square average (other kinds of averages could be considered). and use a box as the window. and equal to the energy of w (t). The area of the circles is proportional to the magnitude of the coefficients. since the windows overlap considerably. and if we want good time resolution of the short bursts. We can improve the frequency discrimination by choosing a w (t) with a smaller Δ f. 12. The other aspect of this problem is that once the window is chosen. Fig. We will position the windows 1 unit apart. This will result in redundancy in the results. we have to sacrifice good frequency description of the long smooth sections. we can use the Walsh transform again. In these figures the 32 rows correspond to the 32 positions of the window. while the 32 columns correspond to the coefficients of the Walsh transform.10 show the result for the two signals. Sikkim Manipal University Page No.

but a simple version is if all the windows are scaled version of each other. To simplify notation.10: Signal 2 analyzed with windowed Walsh transform 12.Continuous Wavelet Transform We can choose any set of windows to achieve the constant relative bandwidth.4 Scaling functions . 202 .Digital Image Processing Unit 12 Figure 12. let us define h (t) as: and scaled versions of h (t) : Sikkim Manipal University Page No.9: Signal 1 analyzed with wind owed Walsh transform Figure 12.

We have used the particular form of h (t) related to the window w (t). but the transform WF() can be defined with any function h(t) satisfying the requirements for a band pass function. space. that is it is sufficiently regular its square integral is finite and its integral ∫ h(t) dt = 0. We can rewrite the basic wavelet as: The transform is then written as: We can reconstruct the signal as: where c is a constant depending on h (t). the coefficients at scale a 1 can be sampled at a lower rate than for a 0 since they correspond to a lower Sikkim Manipal University Page No. and the scaling. since they are defined for every point in the a. corresponds to the filter frequency bandwidth scaling. The WFT now becomes: |a| This is known as a wavelet transform. and the constant 1 / is for energy normalization. a natural question is whether we can discretize a and in such a way that we obtain a true orthonormal basis. but the h a. The reconstruction looks like a sum of coefficients of orthogonal bases. 203 . translated and convolved with the signal to compute the transform. The translation corresponds to moving the window over the time signal.Digital Image Processing Unit 12 where a is the scale factor (that is f = f0 / a ). (t) are in fact highly redundant. which is often called dilation in the context of wavelets. Since there is a lot of redundancy in the continuous application of the basic wavelet. and h (t) is the basic wavelet. It is clear from the above formula that the basic wavelet is scaled. Following Daubechies one can notice that if we consider two scales a 0 < a 1.

we are close to the continuous case. 8.11 in “circle” form and in Fig. Choosing a0 = 2 for the dilation factor. but as a0 increases only very special h(t) will work. 8 x 4 and 16 x 2. In fact the sampling rate can be proportional to a 0 / a 1 Generally. We will limit the spacing so that there is no overlap between the windows of the same width. for a total of 31 transforms. the widths of the boxes will be 32. 4 and 2. 4 x 8. Sikkim Manipal University Page No. 16. 204 .Digital Image Processing Unit 12 frequency. if: ( i and j integers. 12. and the conditions on h(t) will be mild. 12. T a period ) the wavelets are: and the discretized wavelets coefficients are: We hope that with a suitable choice of h(t). 12. The coefficients and reconstructed signal are given in Fig.5 Haar transform We can try again the example of the windowed Walsh transform with the box window. In this case this means spacing of 1 x 32.12 in bar graph form. 2 x 16. a0 and T we can then reconstruct f(t) as: It is clear that for a0 close to 1 and T small.

as seen by the many coefficients of equal magnitude. Sikkim Manipal University Page No. If we consider the Walsh functions and apply the box window properly scaled and translated. and if we remove them we get a new set of basis functions (of course it remains to be proved that they are really basis functions). we can observe that we get a lot of duplicates in the new “basis” functions.13). 12. These happen to be the Haar functions.11: Signal 2 analysed with scaled windowed Walsh transform Figure 12. We can see the windows as applying to the signal or equivalently as applying to the basis functions.12: Signal 2 analysed with scaled windowed Walsh transform (bar graph) It is clear that there is a lot of redundancy in the transforms. 205 . defined by Haar [99] and well known today as the bases for piece-wise constant wavelets (see Fig.Digital Image Processing Unit 12 Figure 12.

14: Haar coefficients for signal 1. It is also clear from the plots that there are many zero coefficients. Figure 12.Digital Image Processing Unit 12 Figure 12. One can prove that the same information is contained in these 32 values that was in the 31 x 32 values of the windowed Walsh transforms.16 shows the Haar coefficients for signal 2 with circles for easier comparisons with the windowed Walsh transform. Figure 12.16: Haar coefficients for signal 2 (circle plot). Fig. and in particular Sikkim Manipal University Page No. 12.13: First 8 Haar bases Fig. 206 . 12.15: Haar coefficients for signal 2.15 show the coefficients of the Haar basis for both of our exemplar signals. 12. Figure 12.14 and Fig.

Sikkim Manipal University Page No. and computed as: We can apply this scheme recursively to the new smoothed signal a(). 12. The computational scheme is shown in Fig.Digital Image Processing Unit 12 for signal 1 the magnitude of the Haar coefficients localize the discontinuities in the signal.17. 12. or a low-pass filter. then the two filters are related as: (where L is the length of the filter. which is half the size of f(). In general. The first one is the box. The reconstruction is then exact. we can compute the subsampled smooth version: and the subsampled detail version: If the smoothing filter is orthogonal to its translates. and the other is the basic Haar wavelet. if we have a low-pass filter h(n). and is a smoothing. It is clear that as in the Haar transform this scheme has only O(n) cost. In our specific example the detail filter picks out exactly what is necessary to reconstruct the signal later.6 Subband coding We can now generalize the concept of image pyramids to what is known in filtering as a subband coding scheme. and a signal f(n)3. which is assumed finite and even). or a detail or a high-pass filter. a high-pass filter g(n). 207 . We have applied recursively two operators to the signal to subsample it by 2. until we have two vectors a() and d() of length 1 after log2(n) applications.

from two different directions (from the windowed Walsh transform and from the difference pyramid).Digital Image Processing Unit 12 Figure 12. 208 . We need better methods than that to construct new wavelets and express their basic properties. Sikkim Manipal University Page No. and H* and G* denote the sum over k of the smoothing and detail filters.17: Discrete wavelet transform as a pyramid The computational scheme for the reconstruction is given in Fig. 12.7 Wavelet functions We have sort of “stumbled” upon the Haar wavelet.18: Reconstructing the signal from wavelet pyramid H is the application (sum over i) of the smoothing filter. G the application of the detail filter. Consider a wavelet function Ψ(t). 12.18. respectively. Figure 12.

Digital Image Processing Unit 12 Let us write Ψi(t) its dilation by a factor of 2 i : The wavelet transform of f(t) at scale 2 i is given by: The dyadic wavelet transform is the sequence of functions We want to see how well WF represents f(t) and how to reconstruct it from its transform. The reconstructing wavelet Ҳ (t) is any function such that its Fourier transform X(f) satisfies: An infinity of Ҳ () satisfies (3) if (2) is valid. If this is true. We can then reconstruct f(t) using: Sikkim Manipal University Page No. Looking at the Fourier transform (we use F(f) or F[f(t)] as notation for the Fourier transform of f(t)): If we impose that there exists two strictly positive constants A and B such that: We guarantee that everywhere on the frequency axis the sum of the dilations of Ψ() have a finite norm. then F(f). and therefore f(t) can be recovered from its dyadic wavelet transform. 209 .

we have to realize that the scales have a lower limit for a discrete signal. We introduce a new smoothing function Φ() such that its Fourier transform is: From (3) one can prove that ∫ Φ(t) dt = 1. . we can deduce a relation between the norms of f(t) and of its wavelet transform: This proves that the wavelet transform is also stable. and can be made close in the L2 norm by having A / B close to 1. and inserting (1) and (3). We can now define the operator: Sikkim Manipal University Page No. 12. and therefore is really a smoothing function (a filter).Digital Image Processing Unit 12 ************************************************************************************** Exercise 2: Prove equation (4) by taking its Fourier transform. in the sense that the some of the information in W i can be contained in others W j subspaces. It is important to note that the wavelet transform may be redundant. Let us say that i = 0 correspond to the limit. ************************************************************************************** Using Parseval’s theorem and equations (2) and (4). 210 .8 Discrete Wavelet transform in one dimension To obtain a discrete transform.

which need only the values of f ( n + w ). The resulting values are all detail coefficients except for a single overall average coefficient. 12. 12.9 Wavelet transforms in two dimensions For many applications. standard and non-standard decomposition (since a multi-dimensional wavelet transform is frequently referred to in the literature as a wavelet decomposition). we first apply the onedimensional wavelet transform to each row of pixel values. This operation gives us an average value along with detail coefficients for each row. 211 . Then the scaling functions and wavelets that form a two dimensional wavelet basis. This again tells us that there is a O(n) scheme to compute this transform. We can then apply the dyadic wavelet transforms of f(t) at the larger scales. Sikkim Manipal University Page No. but it will apply to other bases as well. in particular for image processing and image compression. 1 ≤ i ≤ j. First. we need to generalize wavelets transforms to two dimensions. we treat these transformed rows as if they were themselves an image. This function is not necessarily unique. Next.Digital Image Processing Unit 12 This shows that the high frequencies of f(t) removed by the smoothing operation at scale 2 j can be recovered by the dyadic wavelet transform WFi(t). and apply the one-dimensional transform to each column. we will consider how to perform a wavelet transform of the pixel values in a two-dimensional image. Then the sequence of SFi(n) and WFi(n) is the discrete dyadic wavelet transform of fn.9. where w are integer shifts depending on Ψ ( ) and the scale. We will use the Haar basis as a simple example. We can handle a discrete signal fn by assuming that there exists a function f(t) such that: SF1(n) = fn.1 Standard decomposition To obtain the standard decomposition of an image. This is of course the same scheme used in the generalized multiresolution pyramid. There are two ways we can generalize the one-dimensional wavelet transform to two dimensions.

Digital Image Processing Unit 12 12. 12. j (x) = √2i Φ(2i x – j) form an orthonormal basis for Vi. 212 . j. where Φi. First.9. We will however allow general (nonorthonormal) multiresolutions to be built with a scaling function which satisfies the following: independence: the translates Φi. finer resolution function f(2i) : x  f(2ix) is in the space indexed by i. The orthonormality condition can be relaxed – we will go into this and other generalizations in more detail later. : This condition means that the spaces are shift invariant: integer translates of any function in the space must still be in the space. called the nonstandard decomposition. we perform one step of horizontal pairwise averaging and differencing on the pixel values in each row of the image.10 Multiresolution processing and wavelets An orthonormal multiresolution analysis for L2 generated by the scaling function Φ is a sequence of closed subspaces which satisfy: : This condition states that all functions in the space are arbitrarily close to functions in the multi resolution spaces.2 Non-Standard decomposition The second type of two-dimensional wavelet transform. the spaces Vi correspond to “finer resolution”: if the function f is in the basic multiresolution space V0. Next. As i increases. we apply vertical pairwise averaging and differencing to each column of the result. alternates between operations on rows and columns. The translates Φi. : This is the multiresolution condition. j must be linearly independent Sikkim Manipal University Page No. we repeat this process recursively on the quadrant containing averages in both directions. then the narrower. To complete the transformation.

t. One way to localize the high frequencies while preserving the linearity of the operator is to use a –––––––––––––. for all f generated by the Φ0.12 Terminal Questions 1. This condition guarantees that each function has a unique representation in terms of the translates of Φ. 213 . Define Subband coding. Walsh transform were discussed Wavelet transform and discrete wavelet transform concepts were covered Discussed Wavelet transforms in two dimensions Self Assessment Questions 1. 2. A multi-dimensional wavelet transform is frequently referred to in the literature as a –––––––––––––––.11 Summary We have studied the concepts of Image pyramid and subband coding Different transforms like Haar. A transform similar in properties to the Fourier transform. Discuss the concept of Image pyramids. Explain different methods for wavelet transform in two dimensions. 12. Explain Haar transform. j on level 0 must satisfy : There are positive constants A and B s. j . and that this representation effectively behaves like the representation in an orthonormal basis: the L2 norm of a function is equivalent to the l2 norm : of its coefficient sequence. Sikkim Manipal University Page No. 4.Digital Image Processing Unit 12 stability: the translates Φ0. 3. but with piecewise constant bases is the –––––––––––––. 12. 2. 4. ––––––––– signals are those whose properties do not change much. 3. Explain.

Walsh transform. Refer Section 12.2 2. Windowed Fourier transform (WFT ) 4.Digital Image Processing Unit 12 12.6 4.5 3. 3. Refer Section 12. Refer Section 12. Stationary signals 2.9 Sikkim Manipal University Page No. Wavelet decomposition Terminal Questions 1. 214 .13 Answers Self Assessment Questions 1. Refer Section 12.

B. Sikkim Manipal University Page No. 3. 2. Second Edition. Woods. PHI/Pearson Education. D. PHI. Fundamentals of Digital Image Processing. Prentice Hall. Gonzalez. Rafael C. Jain. 215 . Dutta Majumder. Chanda. Digital Image Processing and Analysis.Digital Image Processing Unit 12 Reference Books: 1. 2003. 2007. Digital Image Processing. Richard E. Anil K. 1989.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->