summary

advertisement
Matching Shapes with a Reference Point
The motivation of the article is a problem which is typical to the application areas such as
computer vision or pattern recognition. Namely given two figures A,B to determine how
much they resemble with each other. By a figure is meant the union of finitely many points
and line segments in the two dimensional space ( 2 ) or triangles in the three dimensional
space ( 3 ) . For the measure of how much two figures resemble there is a use of the
Hausdorff-metric δH.
A small intermezzo to look at the definition, which can be determined in arbitrary dimension
d for the set Cd of all compact subsets of d:
Definition:
For A, B element of Cd let
→
δH (A,B) := max min d2 (a,b)
aЄA bЄB
The Hausdorff-distance between A and B is defined as
→
→
δH (A,B):= max { δH (A,B), δH (B,A) }
The time to compute the Hausdorff-distance δH (A,B) is O(( n+m) log(n+m)) where n and m
are the line segments of A and B.
The problem is often that A and B are not fixed but are transformed. The transformation that
could be the case are translation, rigid motion (translation + rotation), similarity (scaling and
rigid motion). So what we now want to do is to determine for the given figures A and B :
min δH ( A,T(B) )
T Є TR
whereby TR stands for the allowed transformations.
The article does not claim to find an optimal solution to the problem given above, but wants
to find an approximation to the optimal one:
δH ( A,T(B) ) ≤ aδ
This is called an approximate matching with loss factor a (with a >1).
But how does this going to be accomplished? In the next section this will be explained, where
there is the use of the general idea of “reference points” for the approximation algorithms
which give such an approximation .
Example Reference point for translation
To get an impression of reference points let’s take a look at one. The reference points rA ,rB
that are assigned to the sets A and B have the property that when B is transformed to match A
optimally then the distance of the transformed rB to rA is also bounded by a constant factor c
times the Hausdorff-distance of the matching. The factor c is called the quality of the
reference point.
There is a reference point which can be found easily in the case of translations. Assign to a
set A the point rA = (xAmin, yAmin) and the same way assign for the set B the point
rB = (xBmin, yBmin) where xAmin is the smallest x-coordinate and yAmin is the smallest ycoordinate of any point (idem rB). So reference point rA ( respectively rB ) is the lower left
corner point of the smallest axes- parallel rectangle enclosing figure A (respectively B ).
Observe that if in an optimal macth A and the translated image B’ of B have a Hausdorffdistance δ then | xAmin – xB’min | ≤ δ and | yAmin – yB’min | ≤ δ (see figure above). You can
conclude from this by doing Pythagoras that the distance of rA and rB’ (with rB’ is the
translation of rB ) is at most √2δ. So rA is a reference point for A of qualilty √2.
Suppose that we just use the translation that matches rB to rA obtaining an image B’’ of B .
Then since B’ is obtained from B” by translation by the vector rB’ - rA , δH ( B’, B” ) ≤ √2δ.
From this follows:
δH ( A,B” )
≤
≤
δH ( A,B’ ) + δH ( B’,B” )
(√2 + 1) δ
So the Hausdorff distance of the match found by reference points is at most √2 + 1 ≈ 2.4
worse than the optimal one.
The run-time of this of this approximation algorithm is linear, since only the reference points
need to be determined. The best know algorithm for finding the optimal match has a running
time of O((mn)²log3 mn). So the approximation algorithm is much faster.
Reference point in general
Let’s take a look at the formal definition of a reference point, for arbitrary dimension d
Definition: Let TR be a set of transformations on
reference point with respect to TR iff
d.
A mapping r : Cd →
d is
(a) r is equivariant with respect to TR, i.e., for all A,B Є Cd and T Є TR we have
r(T(A)) = T (r(A ))
called a
(b) there exists some constant c≥0 such that if for all A, B Є Cd ,
d2 ( r(A) – r(B) ) ≤ c ∙ δH (A,B)
c is also called the Lipschitz constant c, which is the quality of the reference point r.
Based upon the existence of a reference point for TR we have the following algorithms for
approximately optimal matchings where TR is the set of translations, rigid motions and
similarity transformations.
Algorithm T
1. Compute r(A) and r(B) and translate B by r(A) - r(B) (so that r(B) is mapped onto r(A)) .
Let B’ be the image of B.
2. Output B’ as the approximately optimal solution ( together with the Hausdorff-distance
δH (A,B’).
Algorithm R
1. As in Algortihm T.
2. Find an optimal solution of A and B’ under rotations of B’ around r(A).
3. Output the solution B” and the Hausdorff-distance δH (A,B”).
Algorithm S
1. As in Algortihm T.
2. determine the diameters d(A) and d(B) and scale B’ by α := d(A)/d(B) around the center
r(A).
3. as Step 2 in Algorithm R with the scaled image of B’.
4. as Step 3 in Algorithm R.
Algorithms T and R find an approximately optimal matching for their transformations (
Algorithm T for translations and Algorihm R for rigid motions) with loss factor a = c + 1.
Algorithm S finds an approximately optimal matching for similariy transformations with loss
factor a = c+3.
Steiner point as Reference point
The situation is more complicated for rigid motion. It is not easy to find an appropriate
reference point for rigid motions. The candidate for a reference point is the so called Steiner
point. The definition is as following:
Defintion:
Bd is the d-dimensional unit ball and S d-1 its boundary, the (n-1)- dimensional
unit sphere in d .
hA :
d
Let A be a convex body (convex and compact subset) in
→ of A is given by
hA (u) = max ‹a,u›
aЄA
The Steiner point s(A) of A is defined as
s(A) = ( d / Vol (Sd-1 ) )
∫ hA (u) u dω(u)
Sd-1
d
. The support function
The Steiner point is a reference point for similarity transformations in arbitrary dimension
d≥2. It’s quality is χd , which for d=2 is 4/π , for d=3 it is 3/2, for arbitrary d it lies between
√(2/ π) √d and √(2/ π) √(d+1).
The Steiner point of a convex polytope is the weighted sum of its vertices, where the weight
of vertex v is that fraction of the surface of the unit sphere that lies between the unit vector’s
normal to the planes meeting at v.
Here below you can see the running times and approximately optimal matchings for the
different transformations with the use of the Steiner point as reference point and the
algorithms given above. A and B are sets of n and m line segments in d=2 or n and m triangles
in d=3 dimensions.
TR
translations
d=2
d=3
rigid motions
d=2
d=3
similarities
d=2
d=3
running time
loss factor
O((n + m) log( n+m)
O ( H (n,m) )
4/π + 1 ≈ 2.27
2.5
O(nm log(nm)log*(nm))
O((nm)3H(n,m))
4/π + 1
2.5
O(nm log(nm)log*(nm))
O((nm)3H(n,m))
4/π + 3 ≈ 4.27
4.5
Download