Computing the Hausdorff Distance between Two B-Spline Curves Zachi Shtain Based on the work of: Chen et al. 2010
Definition • Given two curves C 1 , C 2 , their Hausdorff distance is defined as: , max max min ,max min D C C p q p q 1 2 H p C q C q C p C 1 2 2 1 • Where: – are the one-sided maxmin ,maxmin p q p q q C p C p C q C 2 1 1 2 Hausdorff distance – p & q are known as the Hausdorff pair 2
Example 3
Point-Curve Projection • Given a point p and a curve C ( u ), the point projection problem can be described: * min , , p C u p C u u a b • If , we have the following necessary * , u a b condition: * C , ' * 0 p C u u 4
Point-Curve Projection – cont. • Using the condition the problem turns into a root-finding problem of a polynomial equation • Two steps for solving: – Removing intervals which contain no solution – Compute local extrema in each remaining intervals * C , ' * 0 p C u u 5
Point-Curve Projection – Example • Given a Bezier curve defined by the control polygon {(-1, 0) , (0, 2) , (1, 0)} • Find the location(s) on curve which have the minimum distance between the curve and the point (0, 0) 6
Point-Curve Projection – Example – cont. • The inner product yields a Bezier curve defined by the control polygon: {-2 , 4.667, -4.667, 2} * C , ' * 0 p C u u 7
Point-Curve Projection – Example – cont. • Using a subdivision method, we isolate the roots of the polynomial and get: t X Y 0.1563 - 0.6875 0.5273 0.5000 0.0000 1.0000 0.8438 0.6875 0.5273 8
Point-Curve Projection Additional Examples 9
Locations of Hausdorff Distance • The Hausdorff distance can occur at C 1 - discontinuity points (end points) • The Hausdorff distance can occur at antipodal points of the two curves • The Hausdorff distance can occur when one curve intersects the bisector of the second curve 10
Case 1 • The Hausdorff distance can occur at two end points (one end point of each of the curves) 11
Case 2 • The Hausdorff distance can occur at the end point of one the curves and at an inner point of the other curve 0 , ' 0 1 , ' 0 C C v C v C C v C v 1 2 2 1 2 2 0 , ' 0 1 , ' 0 C C v C v C C v C v 2 1 1 2 1 1 0 ,1 v 12
Case 3 • The Hausdorff distance can occur at the two closest inner points , ' 0 C u C v C u 1 2 1 , 0,1 u v , ' 0 C u C v C v 1 2 2 13
Case 4 • The Hausdorff distance can occur at two inner points 2 2 0 C r C t C r C s , , 0,1 r s t i j i j , ' 0 , 1 , 2 C r C s C s i j i j i i j , ' 0 C r C t C t i j j 14
Computing the Hausdorff Distance: The Algebraic Root-Finding Method • Computing all of the roots of the non-linear equations of cases 2-4 • Finding the resulting solution from these roots and the end points as well 0 , ' 0 1 , ' 0 C C v C v C C v C v , ' 0 C u C v C u 1 2 2 1 2 2 1 2 1 , 0,1 u v 0 , ' 0 1 , ' 0 C C v C v C C v C v , ' 0 C u C v C v 2 1 1 2 1 1 1 2 2 0 ,1 v 2 2 0 C r C t C r C s , , 0,1 r s t i j i j , ' 0 , 1 , 2 C r C s C s i j i j i 15 i j , ' 0 C r C t C t i j j
Avoiding Solving Case 4 • Case 4 occurs only when the minimum distance occurs at one than more place • Subdividing the given curves ensures only one place that the minimum distance will occur at • Thus, the trivariate equation system of case 4 can be avoided 16
Improving the Computation • It can be seen that the Hausdorff distance can be computed by solving the one-sided problem twice • The problem turns into a min/max point to curve distance computation problem , max max min ,max min D C C p q p q 17 H 1 2 p C q C q C p C 1 2 2 1
Outline of Algorithm • First, utilize the elimination criteria in the geometric pruning method to prune the sub-intervals • Second, subdivide the given curves in the remaining sub-intervals • Termination conditions are also provided to speed up the process 18
General Geometric Pruning Method for Computing One-Sided Hausdorff Distnace • Given two curves C 1 ( u ) and C 2 ( v ), we want to compute the squared one-sided Hausdorff distance from C 1 ( u ) to C 2 ( v ): , max min , H C u C v S u v 1 1 2 0,1 0,1 u v • where , , S u v C u C v C u C v 1 2 1 2 19
Properties used for Geometric Pruning • Property #1: , min , S u v S u v 0 0 0 0,1 v , , H C u C v S u v 1 1 2 0 0 , max , S u v S u v 0 0 0 u 0,1 • The case where the Hausdorff distance occurs at two end points is detected using this property 20
Properties used for Geometric Pruning – cont. • Property #2: 0,1 : , min , , max , u S u v S u v H C u C v S u v 0 1 1 2 0 0,1 0,1 v u • Property #3: 0,1 : , max , , min , v S u v S u v H C u C v S u v 0 1 1 2 0 0,1 v 0,1 u • The above properties detect the case where the Hausdorff distance occurs at one end point 21
Bounding for the Geometric Pruning • The geometric method need upper and lower bounds for elimination • The bounds can be set as the minimum distances between the end points min , , max , S u v H C u C v S u v 0 1 1 2 0 0,1 v 0,1 u 22
Bounding for the Geometric Pruning – Remark • We have min , , max , S u v v H C u C v S u v u 1 1 2 0,1 v 0,1 u – Where u ( v ) and v ( u ) are functions in v and u – For the case of two Bezier Curves u v v v u u – In B-Spline Cases, u ( v ) and v ( u ) can be set as piecewise linear functions min , , max , S u v H C u C v S u v 23 0 1 1 2 0 0,1 v u 0,1
Geometric Pruning – Subdivision • When all of the properties are not satisfied, the curve C 1 ( u ) should be divided to obtain: L R , max , , , H C u C v H C u C H C u C 1 1 2 1 1 2 1 1 2 • For each v , if the Hausdorff distance cannot occur in the interval L i , then it can be eliminated 24
Elimination Criteria for the Case of Two B-Splines Curves • Given two B-Spline curves i j , 0,1 C u PB u C v Q B v u v 1 2 i n j m i j – – m- th and n- th degree B-spline basis i j , B u B v n m functions over the knot vectors: { 0,...,0 , , ,..., , 1,...,1 } { 0,...,0 , , ,..., , 1,... ,1 } U a a a V b b b 2 3 2 3 n m n+1 n+1 m+1 m+1 • We obtain: n m 1 2 r k , S u v D B u B v , 2 2 r k n m 0 0 r k 25
Elimination Criteria for the Case of Two B-Splines Curves – cont. • Suppose the different knots in the knot vector U i are , 0... u i l m • The interval [0,1] can be partitioned into l sub- L 1 i i intervals , , 0... 1 u u i l i m m • The function S ( u , v ) can be represented in Bezier form as: i m 2 n u u 2 ˆ i r k m , S u v F B t u B v t u r k , 2 n i 2 m i 1 i i u u 0 0 r k m m 26
Recommend
More recommend