Haar Basis Wavelets and Morlet Wavelets September 9 th, 05 Professor Davi Geiger. The Haar transform, which is one of the earliest transform functions proposed, was proposed in 90 by a Hungarian mathematician Alfred Haar. It is found effective as it provides a simple approach for analyzing the local aspects of a signal. Say we start with an image slice (one dimensional) of size NN, so we can write the image as II = {II(), II(),, II( NN )} oooo {II(ii); ii =,, NN } () Recursive Process of Decomposing an Image in terms of Sums and Differences Let us now group the image by consecutive pairs, i.e., {II(ii); ii =,, NN } {[II(), II()], [II(3), II(4)],, [II(ii ), II(ii)],, [II( NN ), II( NN )]} () We can apply the following linear transformation for each pair [II(ii ), II(ii)], i.e., ss (ii) dd (ii) = HH II(ii ) = II(ii) ) II(ii (3) II(ii) So ss (ii) stores the sum of the two elements in a pair and dd (ii) stores the difference of the two elements in a pair. The upper index refers to this transformation being the first step in a process that follows. Of course, this is invertible, i.e., II(ii ) = II(ii) (ii) ss dd (4) (ii) So we can get back the original set of pairs, the original image {II(ii); ii =,, NN }. Thus, we can represent the image II, of size NN, as NN pairs of the form II(ii) {[ss (), dd ()], [ss (), dd ()],, [ss (ii), dd (ii)],, [ss ( NN ), dd ( NN )]} (5) We can then store the set DD = {dd (), dd (), dd (ii),, dd ( NN )} of size NN and we decompose further the complementary set SS = {ss (), ss (), ss (ii),, ss ( NN )} (6) We interpret SS as a new image of half the size of the original one and we represent the set of pairs
SS = {[ss (), ss ()],, [ss (ii ), ss (ii)],, [ss ( NN ), ss ( NN )]} (7) and we apply the reversible linear transformation HH to each pair [ss (ii ), ss (ii)], i.e., ss (ii) dd (ii) = (ii ) ss ss (8) (ii) The upper index refers to the second step in the process. We can then represent the image SS, of size NN, as SS (ii) {[ss (), dd ()], [ss (), dd ()],, [ss (ii), dd (ii)],, [ss ( NN ), dd ( NN )]} (9) Likewise in the first step, we can store the set DD = {dd (), dd (), dd (ii),, dd ( NN )} of size NN and decompose further the set SS = {ss (), ss (), ss (ii),, ss ( NN )} (0) The process can be illustrated for an image of size 4 = 6 pixels as follows Image Step Step II(ii) II II II3 II4 II5 II6 II7 II8 II9 II0 II II II3 II4 II5 II6 ss ss ss 3 ss 4 ss 5 ss 6 ss 7 ss 8 dd dd dd 3 dd 4 dd 5 dd 6 dd 7 dd 8 SS DD ss ss ss 3 ss 4 dd dd dd 3 dd 4 SS DD II = {SS, DD, DD } We now apply the third step of the process on the image set SS, i.e., for each pair [ss (ii ), ss (ii)] we apply the linear transformation ss3 (ii) dd 3 (ii) = (ii ) ss ss () (ii) Leading to two sets DD 3 = {dd 3 (), dd 3 (), dd 3 (ii),, dd 3 ( NN 3 )} ; SS 3 = {ss 3 (), ss 3 (), ss 3 (ii),, ss 3 ( NN 3 )} () Up to the third layer of this process we are left with the following new representation for the image
{II(ii); ii =,, NN } {DD, DD, DD 3, SS 3 } (3) where DD is of size NN, DD of size NN, and DD 3, SS 3 of sizes NN 3 each. All together, of course, there are NN numbers. Every step is reversible, so we can quickly recover the image II from {DD, DD, DD 3, SS 3 }. We could repeat this process up to N steps to obtain DD, DD,, DD ii,, DD NN, SS NN, where SS NN would be one number, representing the sum of all the image values. The Haar Transformation Reviewing our process, we started with equation (), applying a linear transformation HH to each pair of data, or ss (ii) dd (ii) = HH II(ii ) = II(ii) ) II(ii (4) II(ii) We then described the next step as the same linear transformation, HH, applied to the image SS of the first layer, i.e., ss (ii) dd (ii) = HH ss (ii ) ss. We can represent the first and second layer (ii) processes as a linear transformation directly on each four elements of the image (concatenating the two steps and concatenating two pairs of image data), i.e., ss (ii) dd II( ii 3) (ii) dd = HH (ii) 4 II( ii ) II( = II( ii 3) ii ) 4 II( ii ) 0 0 II( ii ) dd (ii + ) II( ii) 0 0 II( ii) (5) In this way, we keep simultaneously both layers (both steps) of the representation of the image. Repeating this process towards the third layer, we apply the linear transformation, HH, to the image SS of the second layer, i.e., ss3 (ii) dd 3 (ii) = (ii ) ss ss. We can (ii) represent this third layer process as a linear transformation directly on each eight elements of the image (concatenating the three steps and concatenating four pairs of image data), i.e.,
ss 3 (ii) dd 3 II( ii 7) (ii) II( ii 6) dd (ii) II( ii 5) dd (ii + ) II( dd (ii) = HH ii 4) 8 II( ii 3) dd (ii + ) II( ii ) dd (ii + ) II( ii ) dd (ii + 3) II( ii) II( ii 7) II( ii 6) 0 0 0 0 = II( ii 5) 0 0 0 0 II( ii 4) 0 0 0 0 0 0 8 II( 0 0 0 0 0 0 ii 3) (6) 0 0 0 0 0 0 II( ii ) 0 0 0 0 0 0 II( ii ) II( ii) More generally one can write the linear transformation HH ii that is applied to each image subset data of size ii, to be HH ii = HH ii [ ] II ii [ ] where II ii is the identify matrix of size i and is the Kronecker product. If AA is an m x n matrix and BB is a p x q matrix, the Kronecker product is given by the mp x nq matrix aa BB aa nn BB AA BB = aa mm BB aa mmmm BB The output of applying HH kk to the full set of image windows of size kk is a representation of the image in the form {DD, DD,, DD kk, SS kk }. The Haar Basis (the function approach) So far we have represented an image as a vector and the wavelet transformation as a matrix multiplication to the vector. We now consider the image as a function of the pixels. The wavelets are functions of the pixels. The result of applying the wavelet transform to the image is then described by the set of convolutions of two functions, the image and each of the wavelets. Let us be more precise. Defining the Haar wavelet basis as a mother wavelet and scaling it by σσ and translating it by b we have
ψψ(xx) = 0 < xx < xx < 0 otherwise ψψ σσ (xx bb) = σσ bb ψψ xx σσ Haar basis ψ(x) Two wavelet properties are required : average is zero and normalization 0 = ψψ σσ (xx bb) dddd and = ψψ σσ (xx bb) dddd For discrete Wavelets is common to assign σσ = jj. Examples with b=0, for σσ = = 0 < xx < oooo 0 < xx < 4 ψψ /(xx) = ψψ(xx) = xx < oooo 4 xx < 0 otherwise σσ = = ψψ (xx) = 0 < xx ψψ xx = < oooo 0 < xx < xx < oooo xx < 0 otherwise σσ = 3 = 8 ψψ (xx) = 0 < xx 8 ψψ xx 8 = 8 8 < oooo 0 < xx < 4 8 xx < oooo 4 xx < 8 8 0 otherwise We can write a row associated to "dd jj (ii)" at (4), (5), (6) as the Haar basis convolution at x=0, i.e., ψψ σσ II (xx) = ψψ σσ (xx ) II(xx xx ) dddd for σσ = jj, jj =, 3,,, 0,,, 3,, respectively (and bb = 0). The Haar wavelet transform is then
WW ψψ ff(σσ, bb) = ψψ σσ (xx bb) II(xx) dddd = σσ ψψ xx bb II(xx) dddd σσ Where ψψ σσ (xx bb) is the complex conjugate of ψψ σσ (xx bb), and for the discrete case, σσ = jj is called the dyadic dilation and bb = kk jj is the dyadic position. So the basis is described by integers j,k. The Morlet Wavelet Basis (a function approach) ψψ DD σσ (xx xx 0 ) = σσ ψψ σσ DD xx xx 0 σσ = CC σσ eeii ππ ξξ σσ (xx xx 0 ) CC ee (xx xx 0 ) σσ And we can plot the real and complex functions (e.g. for σ=, ξ=4 centered in x0=48 pixels) If we convolve the Morlet with a step edge image, I, i.e., (II ψψ σσ DD )(yy) = xx II(yy xx) ψψ σσ DD (xx) Step Edge Real part of the Convolution Imaginary part The zeros of the real part help detect edges as well as the maximum of the complex part.
The Morlet in D (two dimensions), assuming σ=σx=σy, is defined as ψψ σσ,θθ (uu) = CC ππ σσ eeii ξξ σσ (uu.ee θθ ) CC ee uu where uu = (xx, yy), ee θθ = (cos θθ, sin θθ) and ee iiππ ξξ (uu.ee θθ ) = cccccc ππ ξξ σσ (uu. ee θθ) + ii ssssss ππ ξξ σσ (uu. ee θθ). So uu = xx + yy. Let us work with ξξ = 4 (just one peak), so ψψ σσ,θθ (uu) = CC σσ eeii σσ ππ σσ (uu.ee θθ ) CC ee uu σσ Two wavelet properties are required : average is zero and normalization 0 = ψψ σσ (xx bb) dddd Which allow us to obtain CC and CC as follows: First, we obtain CC, real variable, by adjusting it so that and = ψψ σσ (xx bb) dddd 0 = ψψ(uu ) xx yy 0 NN xx NN yy = ee ii ππ σσ (uu.ee θθ ) CC ee uu xx= yy= NN xx NN yy ππ σσ (uu.ee θθ ) ee uu σσ σσ CC = xx= yy= eeii NN NN ee uu xx yy xx= yy= σσ and CC is adjusted so that NN xx NN yy = ψψ(uu )ψψ (uu ) xx= yy= where ψψ (uu ) = CC σσ ee ii ππ ξξ σσ (uu.ee θθ ) CC ee uu σσ is the conjugate of ψψ(uu ).