Wesley Snyder, Ph.D., EMT-P (co

Lecture 2: Matching
point sets
Wesley Snyder, Ph.D., EMT-P
(co-)conqueror of Kilimanjaro
y=
!
x2 dx
(1)
Provide a survey of the state of the art
•
Shape Features/descriptors
•
•
Desirable Properties
Point Set Matching
Bottleneck distance
Hausdorff Distance
Fréchet Distance
NEM Distance
Symmetric Distance
1
Desirable Properties of
shape similarity measure
Nonnegativity: d(A,B)≥0
Identity: d(A,A) = 0
Uniqueness: d(A,B)=> A=B
Strong triangle inequality d(A,B)+d(B,C) ≥ d(A,C)
Properties
Does the triangle inequality make sense?
d(man,centaur) + d(centaur,horse) ≤ d(man,horse)
Figure ripped off from R. Veltcamp and M. Hagedoorn, Shape Similarity Measures, Properties, and Constructions
More About Shape Measures
Invariance under transformations:
d(g(A),g(B)) = cd(A,B) for constant c
Robustness to perturbations, cracks,
blur, noise, occlusion.
Some example measures
No, I don’t have comparative data
This lecture is not sufficiently detailed
for implementation. You need to go to
the original work to get the subtle
details.
Shape Metrics Surveyed here
Bottleneck distance
Hausdorff Distance
Fréchet Distance
NAM Distance
Symmetric Distance
where
C = { C1, C2, . . . , CN }
i
Ck = [ixk , iyk ]T
P2
t=
! A
mpq =
xpy q f (x, y)
Distance betweenm point
sets
m
mx =
10
my =
01
m00
m00
γ
ηpq = µpq /µ00, where γ = p+q
2 + 1.
!
µpq =
(x − mx)p(y − my )q f (x, y)
(1)
Before we can think about distances
between point SET, we need to consider
φ1 = η20 + η02
just distance between points.
2
2
φ2 = (η20 + η02) + 4η11
2
2
φ
=
(η
−
3η
)
+
(3η
−
η
)
3
30
12
21
03two
The Minkowski
distance
between
" d
#1/p
!
POINTS, is
Lp(a, b) =
||ai − bi||p
(2)
(3)
i=0
a ∈ A. Find the b ∈ B such that d(a, b) is maximal. Do this for all
a ∈ A. The BD is the minimum
such distance.
$→
%
−
→
−
H(A, B) = max h (a, b), h (b, a) Stretch s(ai, bj )
is 1 if f (ai−1 ) = bj or f (ai ) = bj−1 and zero otherwise.
Let
t
µpq =
pq
q
p
µ
=
(x
−
m
)
(y
−
m
)
(xpq− mx) (y
xy f (x, y) y f(2)(x, y)
φ1 = η20 +φη1 02= η20 + η02
2
2
2
2
φ2η=
(η
+
η
)
+
4η
φ2 = (η20 +
)
+
4η
20
02
11
1102
2
φ33η
=12(η
3η2112)−2 +
)
φ3 = (η30 −
)230+−(3η
η03(3η
)2 21 − η(3)
03
" d #1/p
#1/p
" d
!
!
p
p
=i − yi|| ||xi − yi||
Lp(a, b) =Lp(a, b)||x
Bottleneck Distance
(2)
φ1 = η20
φ2 = (η20 + η02)2 +
φ3 = (η30 − 3η12)2 + (3η21 −
" d
(3)
!
Lp(a, b) =
||xi − yi||
Let A and
B
be
point
sets.
Let
a ∈ A. Find
b∈B
i=0
i=0
a∈A
a∈
b∈
Bthat
b ∈A B such
d(a,
b) d(a, b) is maximal. Do
the
a∈A
this for all a. The BD is the minimum
such distance.
Let
Let the
. Find
thethat
suchisthat
maximal.
Do this for all
a ∈ A. Find
such
maximal. Do thisis for
all
. The BD
is distance.
the minimum such distance.
∈ A. The BD is the minimum
such
1
. Find the
i=0
such that
d(a, b) is
. The BD is the minimum such distance.
1
In their first book on Pattern Recognition in 1973, Duda and Hart used this measure for distance between
clusters. They called it Dmax
1
φ1 = η20 + η02
γ
2
+ 1. φ2 = (η20 + η02)2 + 4η11
ηpq = µpq /µ00, where γ
!
2
2
p
q
φ
=
(η
−
3η
)
+
(3η
−
η
)
(3)
03
µpq =
(x − mx3) (y −30 my ) f12(x, y) 21(2)
" d
#1/p
!
1 =
Lpφ(a,
b) η=20 + η02 ||xi − yi||p
2
φ2 = (η20 + η02)2 + 4η
11
i=0
φ3 = (η30 − 3η12)2 + (3η21 − η03)2
(3)
Let a ∈ A. Find the b ∈ B such that d(a, b) is maximal. Do this for all
" d
#1/p →
−
→
−
!
Directed Hausdorff
a ∈ A. The BD is thedistance,
minimum such distance. h (a, b) ,hthe
(b, a)
p
Lp(a, b) 1
=
||xi − yi||
m00
p+q
= 2
m00
Hausdorff Distance
maximum over
i=0 all the points in A of the
1
minimum
a∈A
b ∈distances
B
d(a, b)to B.
1
Let
. Find the
such that
is maximal. Do this for all
a ∈ A. The BD is the minimum
such distance.
$→
%
−
→
−
H(A, B) = max h (a, b), h (b, a)
Sensitive to outliers.
1
Well, technically it’s the supremum and infimum, since the sets don’t have to correspond 1:1.
Also, note that this is the largest minimum distance, not the smallest maximum distance like the Bottleneck.
Hausdorff Issues
Two Shapes with a small Hausdorff Distance
HD ignores order
This figure scrounged from http://www.cim.mcgill.ca/~stephane/cs507/Project.html
Fréchet !Distance
s(ai, bj ) + δ(ai, bj )
Suppose a man is walking his dog and that he is constrained to walk on a curve and his dog
on another curve. Both the man and the dog are allowed to control their speed
independently, but are not allowed to go backwards. Then, the Fréchet distance of the
curvesFrechet
is the Distance
minimal length of a leash that is necessary.
Area((A − B) ∪ (B − A))
dF (P, Q) = min{max d(P (α(t)), Q(β(t))}
α,β
t∈[0,1]
where α(t) and β(t) range over continuous and increasing functions with α(0) = 0, α(1) = N, β
(0) = 0 and β(1) = M only.
This equation reads like: for every possible function α(t) and β(t), find the largest distance
between the man and his dog as they walk along their respective path; finally, keep the
smallest distance found among these maximum distances.
Has the advantage (over the Hausdorff) that the adjacency of points along the curve
matters.
/µ00, where γ = 2 + 1.
!
=
(x − mx)p(y − my )q f (x, y)
µpqµ=pq = (x −
) (y
) fy )(xf
(xm
−xm
(y m
−ym
x) −
(2)
φ1 =
φ1 η=20 η+20η+02
2 2 2
φ2 =
φ2 (η
=20(η+20η+02)η02+) 4η
+114
2 2
2
φ3 =
(η
−
3η
)
+
(3η
−
η
)
φ3 =30(η30 −123η12) + (3η
21 21 −
03 η
" "
#
#
1/p
d
d
!!
p p
Lp(a,
b) =
−i y−
||
Lp(a,
b) = ||xi||x
y
i i||
φ1 = η20 + η02
2
φ2 = (η20 + η02)2 + 4η11
2
2
= (η30 − 3η12) + (3η21 − η03)
(3)
" d
#1/p
! Let f be the correspondence function. That
i=0 i=0
(a, b) =
||xi − yi||p
B which
i=0 is, f(a) is the point b in
Let aLet∈
∈b B
b) isb)
maximal
aA
∈. Find
A. the
Findbthe
∈ such
B that
suchd(a,
that d(a,
is ma
a
∈
A
. The
the isminimum
such distance.
a
∈
A
.BD
Theis BD
the
minimum
such distance.
%
$
%
$
corresponds
a.all
Find the b ∈ B such that
d(a, b) is maximal. Do to
this for
→
− →
→
−
−
→
−
b), b),
h (b,
a) a)
Stret
H(A,
B) B)
= max
h (a,
h (b,
H(A,
= maxh (a,
BD is the minimum
such distance.
%
$→
−
→
−
1 if isf1(a
=) b=
fj (a
h (b,
a) Stretch s(ai, bj ) is 1 isif
= max h (a, b),
if fi−1
(a)i−1
or fi )
(a=i) b=
band
andotherwis
zero oth
The
stretch
or
j orb
j−1
j−1zero
= bj or f (ai) = bj−1and zero otherwise.
1
1
Nonlinear Elastic Matching
1
The NAM(A,B) is maximum over all
!
s(ai, bj ) + δ(ai, bj )
correspondences f of
where δ is the difference in tangent
angles at ai and bj.
Symmetric Distance
!
s(ai, bj ) + δ(ai, bj )
Area((A − B) ∪ (B − A))
Interestingly, this one IS a metric
References
Bottleneck Distance
A. Efrat and A. Itai, “Improvements on Bottleneck Matching and Related Problems
using Geometry,” Proc. 12th Intr. Symp. on Computational Geometry, 1996.
Hausdorff Distance
Aichholzer, H. Alt, G. Rote, “Matching Shapes with a Reference Point,” Intr. J.
Computational Geometry and Applications, 7, 1997.
H. Alt, B. Behrends, J. Bloemer, “Approximate Matching of Polygonal Shapes,” Annals of
Mathematics and Artificial Intelligence,” 1995.
P. Chew, M. Goodrich, D. Huttenlocher, K. Kedem, J. Klienberg, and D. Kravets,
“Goemetric Pattern Matching under Euclidian Motion,” Computational Geometry,
Theory and Applicgtions, 1997.
D. Huttenlocher, K. Kedem, and K. Kleinberg, “On Dynamic Voronoi diagrams and the
Minimum Hausdorff Distance for Point Sets under Euclidian Motion in the Plane,”
Proc. 8th ACM Symp. on Computational Geometry, 1992.
D. Huttenlocher, G. Klanderman, and W. Rucklidge, “Comparing Images
using the Hausdorff Distance,” IEEE Trans. PAMI, 1993.
References
Fréchet Distance
H. Alt and M. Godeau, “Computing the Fréchet Distance between two Polygonal CUrves,”
Int. J. Computational Geometry and Applications, 1995.
A. Dumitrescu and G. Rote, “On the Fréchet Distance of a Set of Curves,” 16th Canadian
Conference on Computational Geometry, 2004.
T. Eiter and H. Mannila, “Computing the Discrete Fréchet Distance,” Technical Report
CD-TR 94/64, Christian Doppler Labor für Expertensyteme, Technische Universität,
Wien.
Nonlinear Elastic Matching
G. Cortelazzo, G. Mian, G. Vezzi, and P. Zamperoni, “Trademark Shapes Description by
String-matching Techniques,” Pattern Recognition, 27, 1994.
R. Fagin and L. Stockmeyer, “Relaxing the Triangle Inequality in Pattern Matching,”
IJCV, 28(3), 1998.
Boundary Encoding Methods
In subsequent lectures, I will discuss
four methods, Shape Context, CSS,
SKS, and (if I have time) geodesic
Distance.
I will show that only SKS has
robustness to partial occlusion and will
discuss why.
and now, for something
completely dfferent
Slides generated using LaTeX