Академический Документы
Профессиональный Документы
Культура Документы
Catherine Bnteau, Caroline Haddad, David Ruch and Patrick J. Van Fleet
Department of Mathematics & Statistics University of South Florida Tampa, FL USA
PREP 2009
1/9
T ODAY S S CHEDULE
T ODAY S S CHEDULE
9:00-9:15 Welcome, Introductions 9:15-10:15 Lecture One: Why Wavelets? 10:15-10:30 Coffee Break (SCA 202) 10:30-11:45 Lecture Two: Digital Images 12:00-1:00 Lunch 1:30-2:45 Lecture Three: The Discrete Haar Wavelet Transform 2:45-3:00 Coffee Break (SCA 202) 3:00-4:15 Lecture Four: Coding the HWT, Edge Detection
PREP 2009
2/9
T ODAY S S CHEDULE
O UTLINE
I N THE C LASSROOM
Teaching Ideas Computer Usage
PREP 2009
3/9
I MPLEMENTING WN
The natural inclination when coding the HWT is to simply write a loop and compute the lowpass portion and the highpass portion in the same loop.
PREP 2009
4/9
I MPLEMENTING WN
The natural inclination when coding the HWT is to simply write a loop and compute the lowpass portion and the highpass portion in the same loop. This bogs down in Mathematica and is also difcult to generalize when we consider longer lters.
PREP 2009
4/9
I MPLEMENTING WN
The natural inclination when coding the HWT is to simply write a loop and compute the lowpass portion and the highpass portion in the same loop. This bogs down in Mathematica and is also difcult to generalize when we consider longer lters. If we look at the lowpass portion of the transform, Hv, we can see a better way to code things.
PREP 2009
4/9
I MPLEMENTING WN
v1 v2 v3 v4 v5 v6 v7 v8
v1 + v2 1 v3 + v4 = 2 v5 + v6 v7 + v8
PREP 2009
4/9
I MPLEMENTING WN
v1 v3 = v5 v7
v2 v4 v6 v8
1 2 1 2
= Vh
PREP 2009
4/9
I MPLEMENTING WN
PREP 2009
4/9
I MPLEMENTING WN
Rewriting gives v1 v1 + v2 1 v3 + v4 v3 = Gv = 2 v5 + v6 v5 v7 v7 + v8 v2 v4 v6 v8
1 2 1 2
= Vg
So all we need to do to compute Wn v is to create V , multiply it with h and g, and join to the two blocks together!
PREP 2009
4/9
I MPLEMENTING WN
PREP 2009
4/9
I MPLEMENTING WN
PREP 2009
4/9
T I MPLEMENTING WN
T I MPLEMENTING WN
PREP 2009
5/9
T I MPLEMENTING WN
T I MPLEMENTING WN
Writing the code for the inverse transform is a bit trickier. Now the computation is
T WN v = H T GT v
PREP 2009
5/9
T I MPLEMENTING WN
T I MPLEMENTING WN
Writing the code for the inverse transform is a bit trickier. Now the computation is
T WN v = H T GT v T Lets again look at a vector v R8 and consider the product W8 v:
PREP 2009
5/9
T I MPLEMENTING WN
T I MPLEMENTING WN
T W8 v =
1 1 0 0 0 0 0 0
0 0 1 1 0 0 0 0
0 0 0 0 1 1 0 0
0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 1 0 0 0 1 1 0 0 0 1
v1 v2 v3 v4 v5 v6 v7 v8
PREP 2009
5/9
T I MPLEMENTING WN
T I MPLEMENTING WN
or T W8 v = v1 v5 v1 + v5 v2 v6 v2 + v6 v3 v7 v3 + v7 v4 v8 v4 + v8
PREP 2009
5/9
T I MPLEMENTING WN
T I MPLEMENTING WN
PREP 2009
5/9
T I MPLEMENTING WN
T I MPLEMENTING WN
PREP 2009
5/9
T I MPLEMENTING WN
T I MPLEMENTING WN
We need to dot V with both h = [1, 1]T and g = [1, 1]T but then intertwine the results.
PREP 2009
5/9
T I MPLEMENTING WN
T I MPLEMENTING WN
PREP 2009
5/9
T I MPLEMENTING WN
T I MPLEMENTING WN
PREP 2009
5/9
T I MPLEMENTING WN
T I MPLEMENTING WN
PREP 2009
5/9
T I MPLEMENTING WN
T I MPLEMENTING WN
We can compute
v1 + v5 v + v6 Vh = 2 v3 + v7 v4 + v8
and
v1 v5 v v6 Vg = 2 v3 v7 v4 v8
PREP 2009
5/9
T I MPLEMENTING WN
T I MPLEMENTING WN
PREP 2009
5/9
T I MPLEMENTING WN
T I MPLEMENTING WN
PREP 2009
5/9
T I MPLEMENTING WN
T I MPLEMENTING WN
Lets have a look at the Mathematica notebook HaarTransform1D.nb to see how to code the onedimensional HWT and its inverse.
PREP 2009
5/9
2D H AAR T RANSFORM
C ODING THE 2D T RANSFORM
Coding the 2D Haar transform is easy - we already have a routine that will apply the HWT to each column of A,
PREP 2009
6/9
2D H AAR T RANSFORM
C ODING THE 2D T RANSFORM
Coding the 2D Haar transform is easy - we already have a routine that will apply the HWT to each column of A, We can easily write a routine to compute C = WN A. Lets call this routine W.
PREP 2009
6/9
2D H AAR T RANSFORM
C ODING THE 2D T RANSFORM
Coding the 2D Haar transform is easy - we already have a routine that will apply the HWT to each column of A, We can easily write a routine to compute C = WN A. Lets call this routine W.
T T Our goal is to compute B = WN AWN = CWN .
PREP 2009
6/9
2D H AAR T RANSFORM
C ODING THE 2D T RANSFORM
Coding the 2D Haar transform is easy - we already have a routine that will apply the HWT to each column of A, We can easily write a routine to compute C = WN A. Lets call this routine W.
T T Our goal is to compute B = WN AWN = CWN . T It turns out that writing code for CWN is a bit tedious, but if we use some linear algebra . . .
PREP 2009
6/9
2D H AAR T RANSFORM
C ODING THE 2D T RANSFORM
B T = WN C T
PREP 2009
6/9
2D H AAR T RANSFORM
C ODING THE 2D T RANSFORM
PREP 2009
6/9
2D H AAR T RANSFORM
C ODING THE 2D T RANSFORM
B T = WN C T So we can simply apply W to C T and transpose the result. One student wasnt so sure about this . . .
PREP 2009
6/9
2D H AAR T RANSFORM
C ODING THE 2D T RANSFORM
PREP 2009
6/9
I N THE C LASSROOM
T EACHING I DEAS
I N THE C LASSROOM
T EACHING I DEAS
The students really enjoy the material in this chapter. It is quite straightforward and ties together everything new weve done to date.
PREP 2009
7/9
I N THE C LASSROOM
T EACHING I DEAS
I N THE C LASSROOM
T EACHING I DEAS
The students really enjoy the material in this chapter. It is quite straightforward and ties together everything new weve done to date. We have them look at the entropy of particular vectors when processed by the Haar transform. This gives them some idea of the potential for wavelet-based compression.
PREP 2009
7/9
I N THE C LASSROOM
C OMPUTER U SAGE
I N THE C LASSROOM
C OMPUTER U SAGE
PREP 2009
8/9
I N THE C LASSROOM
C OMPUTER U SAGE
I N THE C LASSROOM
C OMPUTER U SAGE
As you might imagine, we do lots of coding in this chapter. We let the students work in pairs and they write code for the Haar transform and its inverse (1D and 2D) as well as iterated versions.
PREP 2009
8/9
I N THE C LASSROOM
C OMPUTER U SAGE
I N THE C LASSROOM
C OMPUTER U SAGE
As you might imagine, we do lots of coding in this chapter. We let the students work in pairs and they write code for the Haar transform and its inverse (1D and 2D) as well as iterated versions. They can get pretty frustrated with Mathematica at this point - it is good to show them some simple debugging techniques.
PREP 2009
8/9
I N THE C LASSROOM
C OMPUTER U SAGE
I N THE C LASSROOM
C OMPUTER U SAGE
PREP 2009
8/9
I N THE C LASSROOM
C OMPUTER U SAGE
I N THE C LASSROOM
C OMPUTER U SAGE
We let them use their own images/audio les (sometimes dangerous). To test their iterated 1D inverse, they must download an audio clip from the course web site that has been transformed p times, guess at p, and then apply their inverse to guess the movie clip.
PREP 2009
8/9
T ODAY S S CHEDULE
9:00-9:15 Welcome, Introductions 9:15-10:15 Lecture One: Why Wavelets? 10:15-10:30 Coffee Break (SCA 202) 10:30-11:45 Lecture Two: Digital Images 12:00-1:00 Lunch 1:30-2:45 Lecture Three: The Discrete Haar Wavelet Transform 2:45-3:00 Coffee Break (SCA 202) 3:00-4:15 Lecture Four: Coding the HWT, Edge Detection Dinner and free time
PREP 2009
9/9