250 likes | 458 Views
Matching Shapes with a Reference Point. Volkan Çardak. Problem. Given two figures A,B Determine how much they “resemble each other” Figure = union of finitely many points and line segments in two dimensions or triangles in three dimensions. Measure for “resemblance”.
E N D
Matching Shapes with a Reference Point Volkan Çardak
Problem • Given two figures A,B • Determine how much they “resemble each other” • Figure = union of finitely many points and line segments in two dimensions or triangles in three dimensions
Measure for “resemblance” • Hausdorff-metric δH • Recall : For A, B element of Cd let → δH (A,B) := max min d2 (a,b) a Є A b Є B • Hausdorff-distance between two sets A and B → → δH (A,B):= max {δH (A,B), δH (B,A) }
Measure for “resemblance” • This can be done in O((n+m) log(n+m)) [ABB] • But more natural: Figures A,B are not fixed but can be moved • So a need for transformations • Translation • Rigid motion • Similarity
So what to determine? • min δH( A,T(B) ) T Є TR • Does it make any difference if we exchange the sets A and B in this problem?
Finding optimal matches in 2d • In [ABB] an algorithm of O( (nm log(nm) log*(nm) ) for TR = translation along one fixed direction • In [AST] one of O( (nm)2 log3(nm) ) for TR = arbitrary translations • In [CGHKKK] an O( (nm)3log2(nm) ) for TR = arbitrary rigid motions • Latter two not applicable
Optimal vs Approximation • Try not to find an optimal solution but an approximation to the optimal one by simpler algorithms • Let’s assume optimal match yields the Hausdorff-distance δ • These simpler algortihms will find a matching T such that δH ( A,T(B) ) ≤ αδ constant α>1 • Approximate matching with loss factor α
How to do the approximation? • The idea is to use “reference points” for the approximation algortihms • By using reference points with the approximation algorithms more favourable run time • Before we take a look at the defintion let’s take a look at a simple reference point
Reference Point example • Only applicable for translations • Reference point rA= (xAmin ,yAmin ) • The points rA and rB that are assigned to sets A,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 times the Hausdorff distance of the matching. • figure
Reference Point example • With an optimal match then the following holds: | xAmin – xB’min | ≤δ & | yAmin – yB’min | ≤δ (B’ is translated image of B) • rA is as reference point for A of quality √2
Reference Point example • Instead of finding optimal translation of B to match A we just match rB to rA to obtain an image B” of B. • δH ( A,B” ) ≤ δH ( A,B’ ) + δH ( B’ ,B” ) ≤ (√2+ 1) δ • So the Hausdorff-distance of the match found by the reference points is at most by a factor √2 + 1 ≈ 2.4 worse than the optimal one
Optimal vs Approximation (again) • The approximation algorithm has a lineair running time, since you only need to determine the reference points • Best known algorithm for finding the optimal match O( (mn)2 log3(mn) ) (recap from slide 6) • Which approximation algorithms, later in this presentation
Reference Point (definition) • So far we have only seen an example of a reference point for translations • Definition: Let TR be a set of transformations on Rd . A mapping r: Cd → Rd is called a reference point with respect to TR iff • 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) ) and • There exists some constant c ≥ 0 such that if for all A,B ЄCd , d2 ( r(A), r(B) ) ≤ c δH(A,B)
Approximation algorithms • Based on the existence of a reference point for TR there are the following 3 algorithms for approximately optimal matchings where TR stand for the set of translations, rigig motions and similiraty transformations.
Approximation algorithms • Algorithm T • 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. • Output B’ as the approximately optimalsolution ( tohether with the Hausdorff-distance δH(A,B’) )
Approximation algorithms • Algorithm R • As in Algorithm T. • Find an optimal matching of A and B’ under rotations of B’ around r(A) . • Output the solution B” and the Hausdorff-distance δH(A,B”)
Approximation algorithms • Algorithm S • As in Algorithm T. • Determine the diameters d(A) and d(B) and scale B’ by α:= d(A) / d(B) around the center r(A) . • as step 2 in algorithm R with the scaled image of B’. • as step 3 in algorithm R.
Loss factors of the algorithms • These algorithms are simpler than the ones for finding the optimal solutions, since after step 1 the matchings are restricted to ones leaving the reference point invariant → in d dimensions this eliminates d degrees of freedom. • Algorithm T finds approximately optimal matching for translations with loss factor α = c+1 • Algorithm R finds approximately optimal matching for rigid motions with loss factor α = c+1 • Algorithm S finds approximately optimal matching for similarity transformations with loss factor α = c+3
Runtimes algorithms • Algorithm T : lineair • Algorithm R : problem is how to find the optimal matching under rotations. This can be done in O( nmlog(nm) log*(nm) ) in the plane [ABB]. So this is also the overall runtime • Algorithm S : also O( nmlog(nm) log*(nm) )
Reference point: Steiner Point • We have seen a reference point which holds for translations. • Now let’s take a look at the Steiner Point, which is a reference point which for translations, rigid motions, scaling.
Reference point: Steiner Point • Definition: Bd is the d-dimensional unit ball and Sd-1 its boundary, the (n-1)- dimensional unit sphere in Rd. Let A be a convex body (convex and compact subset) in Rd. The support functionhA : Rd → R 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 ∫ hA (u) u dω(u) ──── Sd-1 Vol (Sd-1 )
Reference point: Steiner Point • The Steiner point is a reference point for similarity transformations in arbitrary dimension d≥2. Quality is χd . 2d Vol(Bd-1 ) χd =______________ Vol(Sd-1 )
Reference point: Steiner Point • For a polygon the Steiner point can be computed easily. It is the weighted average of the vertices where each vertex is weighted by its exterior angle divided by 2 π. n • s(P) = 1/(2 π) ∑ φi ∙ vi i=1 • This can be done in lineair time
References • [AAR] O.Aichholzer, H.Alt and G.Rote, Matching shapes with a Reference Point, 2001 • [ABB] H.Alt, B.Behrends and J.Blömer, Approximate matching of polygonal shapes, Proceedings 7th Annual Symposium on Computational Geometry, 1991, 186-193 • [AST] P.J. Agarwal, M.Sharir and S.Toledo, Applications of parametric searching in geometric optimization, Proc. 3rd ACM-SIAM Sympos.Dicrete Algorithms, 1992, 72-82 • [CGKKK] P.P.Chew, M.T.Goodrich, D.P. Huttenlocher, K.Kedem, J.M. Kleinberg. D.Kravets, Geometric pattern matching under Euclidean motion, Proc.5th Canadian Conference on Computational Geometry, 1993, 151-156