Download as pdf or txt
Download as pdf or txt
You are on page 1of 25

Page 1

1
Recap
Haar
I simple and fast wavelet transform
Limitations
I not smooth enough: blocky
How to improve?
I classical approach: basis functions
I Lifting: transforms
2
Erasing Haar Coefficients
Page 2
3
Classical Constructions
Fourier analysis
I regular samples, infinite setting
I analysis of polynomials
Conditions:
I smoothness
I perfect reconstruction
But...
I Fourier analysis not always applicable
4
Lifting Scheme
Custom design construction
I entirely in spatial domain
Second generation wavelets
I boundaries
I irregular samples
I curves, surfaces, volumes
Page 3
5
Haar Transform
Averages and differences
I two neighboring samples
a b
s = a + b ( ) 2
d = b a
a = s d 2
b = s + d 2
6
Haar Transform
In-place Version
I want to overwrite old values with new values
I rewrite
I inverse: run code backwards!
b -= a; a += b/2;
a -= b/2; b += a;
d = b a s = a + d 2
Page 4
7
Haar Transform
Forward
for( s = 2; s <= n; s *= 2 )
for( k = 0; k < n; k += s ){
c[k+s/2] -= c[k];
c[k] += c[k+s/2] / 2;
}
8
Haar Transform
Inverse
for( s = n; s >= 2; s /= 2 )
for( k = 0; k < n; k += s ){
c[k] -= c[k+s/2] / 2;
c[k+s/2] += c[k];
}
Page 5
9
Haar Transform
Lifting version
I split into even and odd
I predict and store difference: detail coefficient
I update even with detail: smooth coefficient
(even
j-1
,odd
j-1
):= Split(s
j
)
d
j-1
= odd
j-1
- even
j-1
s
j-1
= even
j-1
+ d
j-1
/2
10
Haar Transform
d
j-1
= odd
j-1
- P(even
j-1
)
s
j-1
= even
j-1
+ U(d
j-1
)
P U
even
odd detail
smooth
s
j
d
j-1
s
j-1
split
Page 6
11
Haar Transform
Predict
I perfect if function is constant
I detail coefficients zero
I removes constant correlation
Update
I preserve averages of coarser versions
I avoid aliasing
I obtain frequency localization
12
Haar Transform
P U
even
odd detail
smooth
s
j
d
j-1
s
j-1
split
Page 7
13
Lifting Scheme
Advantages
I in-place computation
I efficient, general
I parallelism exposed
I easy to invert
P U
merge
P U
split
14
Lifting
Build more powerful versions
I higher order prediction
I Haar has order 1
I higher order update
I preserve more moments of coarser data
An example
I linear wavelet transform
Page 8
15
Linear Prediction
Use even on either side
I keep difference with prediction
I exploit more coherence/smoothness/
correlation
original
predict
even
16
Prediction
failure to be linear detail
even
odd
detail
d
k
= a
2k+1
1 2 a
2k
+ a
2k+2
( )
Page 9
17
Update
Even values are subsampled
I aliasing!
DC components different
average different
18
Update
zero mean detail
add
detail
even
smooth
s
k
= a
2k
+ 1 4 d
k1
+ d
k
( )
Page 10
19
Inplace Wavelet Transform
-/
/
-/
/
even odd
smooth detail
20
Linear Wavelet Transform
Order
I linear accuracy: 2nd order
I linear moments preserved: 2nd order
I (2,2) of Cohen-Daubechies-Feauveau
Extend
I build higher polynomial order predictors
P
U
split
Page 11
21
Higher Order Prediction
linear cubic
22
Higher Order Prediction
Use more (D) neighbors on left and right
I define interpolating polynomial of order N=D
I sample at midpoint for prediction value
I example: D=
effective weights:
-/6 /6 /6 -/6
Page 12
23
Summary
Lifting Scheme
I construction of transforms
I spatial, Fourier
Haar example
I rewriting Haar in place
Two steps
I Predict
I Update
24
Summary
Predict
I detail coefficient is failure of prediction
Update
I smooth coefficient to preserve moments, e.g.,
average
Higher order extensions
I increase order of prediction and update
Page 13
25
Building Blocks
Transform
I forward
I inverse
I superposition
building blocks
W s
n,k
{ }
= d
j,l
{ }
s
n,k
{ }
= W
1
d
j,l
{ }
s
n,k
{ }
= d
j,l

W
1

j,l
{ }
26
Scaling Functions
Cascade/Subdivision
I single smooth coefficient
delta sequence

P U
merge
Page 14
27
Scaling Functions
Cascade/Subdivision
28
-4 -3 -2 -1 0 1 2 3 4
-0.5
0.0
0.5
1.0
-4 -3 -2 -1 0 1 2 3 4
-0.5
0.0
0.5
1.0
-4 -3 -2 -1 0 1 2 3 4
-0.5
0.0
0.5
1.0
-4 -3 -2 -1 0 1 2 3 4
-0.5
0.0
0.5
1.0
Scaling Functions
N = N =
N = 6 N =
Page 15
29
Twoscale Relation
Scaling function


subdivide
h
l
{ }
x ( ) = h
l
2x l ( )

x ( )
30
Duality
Function at successive scales
coarse fine
s
j,k

j,k
x ( )
k

= f x ( ) = s
j+1,l

j+1,l
x ( )
l


M
s
j+1,l
M

= H
M
s
j,k
M


L
j,k
L
( )
= L
j+1,l
L
( )
H
column vectors of coefficients
row vectors of bases
Page 16
31
Interpolating Scaling Functions
Properties for order N=D
I compact support:
I interpolation:
I polynomial reproduction:
x ( ) = 0 x N+ 1,N 1 [ ]
k ( ) =
k
k
p
x k ( )
k

= x
p
32
Interpolating Scaling Functions
Properties for order N=D
I smoothness:
I twoscale relation:

j,k
C
N ( )
x ( ) = h
l
2x l ( )
l=N
N

s
j+1,l
= h
l2k
s
j,k
k


j,k
x ( ) = h
l2k

j+1,l
x ( )
l

Page 17
33
Wavelets
Cascade/Subdivision
I single detail coefficient
delta sequence

P U
merge
34
-4 -3 -2 -1 0 1 2 3 4
-0.5
0.0
0.5
-4 -3 -2 -1 0 1 2 3 4
-0.5
0.0
0.5
-4 -3 -2 -1 0 1 2 3 4
-0.5
0.0
0.5
-4 -3 -2 -1 0 1 2 3 4
-0.5
0.0
0.5
Wavelets
N =
N = 6 N =
N =
Page 18
35
Twoscale Relation
Wavelet

-
1
/8---
1
/8
cascade
x ( )
g
l
{ }
x ( ) = g
l
2x l ( )

36
Page 19
37
Average Interpolation
constant quadratic
38
Page 20
39
Average Interpolation
Idea
I assume observed samples are averages
I which polynomial would have produced those
averages?

Ls
j,k1
s
j,k
s
j,k+1
L
observation
match
p x ( )
s
j+1,2k
s
j+1,2k+1
finer averages
40
Average Interpolation
Page 21
41
-4 -3 -2 -1 0 1 2 3 4
-0.5
0.0
0.5
1.0
-4 -3 -2 -1 0 1 2 3 4
-0.5
0.0
0.5
1.0
-4 -3 -2 -1 0 1 2 3 4
-0.5
0.0
0.5
1.0
-4 -3 -2 -1 0 1 2 3 4
-0.5
0.0
0.5
1.0
Scaling Functions
N = N =
N = N =
42
Average Interpolating Scaling Functions
Properties for order N=D+
I compact support:
I average interpolation:
I polynomial reproduction:
x ( ) = 0 x N+ 1,N [ ]
Ave x
p
,k
( )
x k ( )
k

= x
p
x ( )dx
k
k+1

=
k
Page 22
43
Average Interpolating Scaling Functions
Properties for order N=D+
I smoothness:
I twoscale relation:

j,k
C
N ( )
x ( ) = h
l
2x l ( )
l=N+1
N

j,k
x ( ) = h
l2k

j+1,l
x ( )
l

s
j+1,l
= h
l2k
s
j,k
k

44
Wavelets
-4 -3 -2 -1 0 1 2 3 4
-0.5
0.0
0.5
N =
-4 -3 -2 -1 0 1 2 3 4
-0.5
0.0
0.5
N =
-4 -3 -2 -1 0 1 2 3 4
-0.5
0.0
0.5
N =
-4 -3 -2 -1 0 1 2 3 4
-0.5
0.0
0.5
N =
Page 23
45
Differentiation
Interpolation and average interpolation
I given interpolation sequence compute exact
derivative
s
0,k
{ } N = 2D
N = 2D 1
s
0,k
= s
0,k+1
s
0,k
{ }
d
dx

I
x ( ) =
AI
x + 1 ( )
AI
x ( )
46
Page 24
47
Subdivision
I generate {1,4,6,4,1}
Cubic B-splines
s
j+1,2k+1
= s
j,k
+ s
j,k+1
( )
2
s
j+1,2k
= s
j,k
+ s
j+1,2k1
+ s
j,2k+1
( )
2
P U P
/2
merge
48
Cubic B-spline Wavelet
Completing the space
I put delta on detail wire: {1,4,1}
I get vanishing moment with update stage:
{3/8,3/8}

P U P
/2
merge
Page 25
49
Cubic B-spline
-4 -3 -2 -1 0 1 2 3 4
-0.5
0.0
0.5
1.0
-4 -3 -2 -1 0 1 2 3 4
-0.5
0.0
0.5
Scaling function Wavelet
50

You might also like