Axial Flip Invariance and Fast Exhaustive Searching with Wavelets
Matthew Bolitho
Outline
Goals Shape Descriptors
Invariance to rigid transformation Wavelets
The wavelet transform Haar basis functions Axial ambiguity with wavelets
Axial ambiguity Invariance Fast Exhaustive Searching
Wavelet based Shape Descriptor
Voxel based descriptorRasterise model into voxel gridApply Wavelet TransformSubset of information into feature vectorsCompare vectors
Shape Descriptor Goals
Concise to store Quick to compute Efficient to match Discriminating Invariant to transformations Invariant to deformations Insensitive to noise Insensitive to topology Robust to degeneracies
Project focus
Invariance to transformation Efficient matching
Scale, Translation, Rotation Invariance Invariance through normalisation Scale: scale voxel grid such that is just fits
the whole model Translation: set the origin of voxel grid to
be model center of mass Rotation: Principal Component Analysis
Principal Component Analysis
Align model to a canonical frame Calculate variance of points Eigen-values of covariance matrix map to
(x,y,z) axes in order of size
[1]
Axial Ambiguity
PCA has a problem Eigen-values are only defined up to sign In 3D, flip about x,y,z axes
[1]
Resolving the Ambiguity
Exhaustive search approachCompare all possible alignments (8 in 3D)Select alignment with minimal distance as
best match An invariant approach: make comparison
invariant to axial flip
The Wavelet Transform
Transforms a function to a new basis: Haar basis functions
Invertible Non-Lossy
[2]
Haar Basis Functions
Family of step functions i specifies frequency family j indexes family Orthogonal Orthonormal when scaled
by
Fast to compute Compute in-place
120
0
)2()(
15.0
5.00
0
1
1
)(
,
j
iji
j
i
jxx
otherwise
x
x
x
i2
Constant Function
+1
-1
01½
1)( xc
Family i=0
+1
-1
01½
x(x)
)()(0,0 xx
Family i=1
+1
-1
01½
x(x)
)12()(
)2()(
1,1
0,1
xx
xx
+1
-1
01½
x(x)
Family i=2+1
-1
01½
x(x)
)34()(
)24()(
)14()(
)4()(
3,2
2,2
1,2
0,2
xx
xx
xx
xx
+1
-1
01½
x(x)
+1
-1
01½
x(x)
+1
-1
01½
x(x)
Nomenclature
Adopt a more convenient indexing scheme
)(
)(
)(
)(
)(
)(
)(
)(
3,27
2,26
1,25
0,24
1,13
0,12
0,01
0
xf
xf
xf
xf
xf
xf
xf
xf c
i=2
i=1
i=0
Vector Basis
Basis functions can also be represented as a set of orthonormal basis vectors:
Wavelet transform of function g is:
4
3210
2105.05.0
2105.05.0
0215.05.0
0215.05.0
H
hhhh
g
ii
gHgW
hggW
)(
,)(
Example
Given a function Wavelet transform is
Aside: given function
5524g
02228
5524
)(
4
4
H
gHgW
22028)(
4255
hW
h
Resolving Axial Ambiguity
Exploit wavelets to get:Axial Flip Invariance
Make Wavelet Transform invariant to axial flip
Fast Exhaustive Search Reduce the complexity of exhaustively testing all
permutations of flip (recall: 8 in 3D)
Observation
+1
-1
01½
x(x)+1
-1
01½
x(x)
00 ff
Observation
+1
-1
01½
x(x)+1
-1
01½
x(x)
11 ff
Observation
+1
-1
01½
x(x)+1
-1
01½
x(x)
32 ff
Observation
+1
-1
01½
x(x)+1
-1
01½
x(x)
74 ff
Observation
+1
-1
01½
x(x)+1
-1
01½
x(x)
65 ff
Wavelets and Axial Flip
Established a mapping for axial flip
f0 itself
f1 inverse of itself
Pairs inverse of each other
47
56
65
74
23
32
11
00
ff
ff
ff
ff
ff
ff
ff
ff
Invariance
Goal: Discard information that determines flip Goal: Not loose too much information
Use mapping to make wavelet transform invariant to flip f0 is already invariant | f1 | is invariant
Pairs are not, yet…
Invariance with pairs
For a pair
So, a+b and a-b behave like f1 and f0 under axial flip
Note: when a+b and a-b are known, a and b can be known – no loss of information; transform invertible
abba
)( ba
abba
ba
abba
Observation
+1
-1
01½
x(x)+1
-1
01½
x(x)
3232 ffff
Observation
+1
-1
01½
x(x)+1
-1
01½
x(x)
3232 ffff
A New Basis
Redefine basis with a new mapping S( f )
Now all coefficients either map to themselves (+) or their inverse (-) under reflection
)(
)(
)(
)(
)(
)(
)(
)(
747
656
655
744
323
322
11
00
fff
fff
fff
fff
fff
fff
ff
ff
Invariance
New basis defines reflections with change in sign of half the coefficients
Invariance: Store f0, f3, f6, f7
Store absolute value of f1, f2, f4, f5, …
)(),(,)(,)(),(,)(,)(),( 76543210 fSfSfSfSfSfSfSfSS I
Invariance Example
Given g and h from previous example
Perform wavelet transform:
Transform basis:
5524g 4255h
02228)( gW 22028)( hW
02202228))(( gWS I
222228
22022028))((
hWS I
Invariance Evaluation
AdvantagesOnly perform single comparison
DisadvantageDiscards sign of half the coefficients
may hurt ability to discriminate
Exhaustive Searching
Rather than making comparison invariant, perform it a number of times:
R is the set of all possible axial reflections
Good Idea: If possible reduce this comparison cost fast exhaustive searching
RhgRhg 22)(min
Fast Exhaustive searching
Distance between g and h, R(g) and h:
Recall gi , hi : sign according to axial reflection
iiii
ii
hghg
hg
hg
2
)(22
2
2
0
iiii
ii
hgRhgR
hgR
hgR
)(2)(
))((
)(
22
2
2
1
22)(gRg
Fast Exhaustive searching iiii hghg 222
0 iiii hgRhg )(2221
7766554433221100 hghghghghghghghghg ii
77665544
33221100
)()()()(
)()()()()(
hgRhgRhgRhgR
hgRhgRhgRhgRhgR ii
Recall the mapping of R(gi) gi, thus:
7766554433221100)( hghghghghghghghghgR ii
Fast Exhaustive searching 5544221177663300 hghghghghghghghghg ii
5544221177663300
5544221177663300)(
hghghghghghghghg
hghghghghghghghghgR ii
Collect together terms to form:
55442211
77663300
hghghghggh
hghghghggh
ghghhgR
ghghhg
ii
ii
)(
Fast Exhaustive searching
Now, we can express andonly in terms of gi and hi
We can calculate both from the decomposition of the first, with minimal extra computation
2hg 2
)( hgR
ghghhg
hg
ii 222
2
0
ghghhg
hgR
ii 2
)(22
2
1
Fast Exhaustive search Example
Given g and h from previous examplesTransform basis:
222228
02202228))((
gWS
222228
22022028))((
hWS
Fast Exhaustive search Example
Calculate gh+ and gh- from S(W(g)) and S(W(h)):
Calculate norms:
4
66
2211
3300
hghggh
hghggh
0
)466(27070
2)(
16
)466(27070
2
222
222
ghghhghgR
ghghhghg
Fast search Evaluation
For minimal extra computation, all permutations of flip can be compared
No information is discardedc.f. invariance
Higher Dimensions
Both invariance and fast exhaustive search apply to higher dimensions
As dimensionality increases, invariance needs to discard more and more information In 2D, 4 flips In 3D, 8 flips
Applying Transforms in 2D
Transform rows S(W(r0)
S(W(r1)
r5
...
...
r15
c0
c1
...
c15
Applying Transforms in 2D
Transform columns S(W(r0)
S(W(r1)
r5
...
...
r15
S(W(c
0 ))
S(W(c
1 )) ...
c15
c5
...
Exhaustive Searching in 2D
In 1D we had gh+ and gh-
In 2D we will have gh++, gh+-, gh-+ and gh--
By applying both W(g) and S(g) in rows then columns, the 2D flip problem is reduced to two 1D flip problemsThis makes the cross multiplication easier
Cross multiplication
gh++, gh+-, gh-+ and gh--
are determined by cross multiplying the grid + * + = gh++
etc
+--+--++----++++
+ - - + - - + - - - - + + + ++
Exhaustive Searching in 2D
ghghghghgRg
ghghghghgRg
ghghghghgRg
ghghghghgg
xy
y
x
:)(
:)(
:)(
:
2222 hghg
In 3D
The extension into 3D is similar:8 flips8 gh terms8 ways to combine gh terms
Conclusion
Presented a way to overcome PCA alignment ambiguityWith minimal extra computationWith no loss of useful shape information
Conclusion II
PCA still has problems Instability: Small change in PCA alignment
can change voxel vote
Gaussian smoothing can distribute votes better
Future Work
Integrate into complete shape descriptorConcise to storeQuick to computeDiscriminatingRobustnessetc
Actual precision vs. recall results
References
[1] Misha Kazhdan: Alignment slides, October 25 2004 [2] Original teapot image from
http://www.plunk.org/~grantham/public/graphics.html