between Two B-Spline Curves Zachi Shtain Based on the work of: Chen - - PowerPoint PPT Presentation

between two b spline curves
SMART_READER_LITE
LIVE PREVIEW

between Two B-Spline Curves Zachi Shtain Based on the work of: Chen - - PowerPoint PPT Presentation

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


slide-1
SLIDE 1

Computing the Hausdorff Distance between Two B-Spline Curves

Zachi Shtain

Based on the work of: Chen et al. 2010

slide-2
SLIDE 2

Definition

  • Given two curves C1, C2, their Hausdorff distance

is defined as:

  • Where:

– are the one-sided Hausdorff distance – p & q are known as the Hausdorff pair

 

 

2 1 1 2

1 2

, max max min ,max min

H q C p C p C q C

D C C p q p q

   

  

2 1 1 2

maxmin ,maxmin

q C p C p C q C

p q p q

   

 

2

slide-3
SLIDE 3

Example

3

slide-4
SLIDE 4

Point-Curve Projection

  • Given a point p and a curve C(u), the point

projection problem can be described:

  • If , we have the following necessary

condition:

4

   

 

 

* min , , p C u p C u u a b    

   

, ' * * C p u u C  

 

* , u a b 

slide-5
SLIDE 5

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

5

   

, ' * * C p u u C  

slide-6
SLIDE 6

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

slide-7
SLIDE 7

Point-Curve Projection – Example – cont.

  • The inner product yields a Bezier curve defined

by the control polygon: {-2 , 4.667, -4.667, 2}

7

   

, ' * * C p u u C  

slide-8
SLIDE 8

Point-Curve Projection – Example – cont.

  • Using a subdivision method, we isolate the roots
  • f the polynomial and get:

8

Y X t 0.5273 0.6875

  • 0.1563

1.0000 0.0000 0.5000 0.5273 0.6875 0.8438

slide-9
SLIDE 9

Point-Curve Projection Additional Examples

9

slide-10
SLIDE 10

Locations of Hausdorff Distance

  • The Hausdorff distance can occur at C1-

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

slide-11
SLIDE 11

Case 1

  • The Hausdorff distance can occur at two end

points (one end point of each of the curves)

11

slide-12
SLIDE 12

Case 2

  • The Hausdorff distance can occur at the end point
  • f one the curves and at an inner point of the
  • ther curve

                         

1 2 1 2 2 1 2 1 2 2 1 1

1 , ' , ' ' ' , 1 , ,1 C v C v C v C C v C C v C C v C v v v C C         

12

slide-13
SLIDE 13

Case 3

  • The Hausdorff distance can occur at the two

closest inner points

           

 

1 1 1 2 2 2

' , , 0,1 , ' C u C v u v C u C v C v C u     

13

slide-14
SLIDE 14

Case 4

  • The Hausdorff distance can occur at two inner

points

                     

2 2

, , 0,1 , , ' , 1 2 ' ,

i j i j i j j i j i

C r C t C r C s r s t C r C s i j i C C s j C t r C t           

14

slide-15
SLIDE 15

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

15

                     

2 2

, , 0,1 , , ' , 1 2 ' ,

i j i j i j j i j i

C r C t C r C s r s t C r C s i j i C C s j C t r C t           

             

1 1 1 2 2 2

' , , 0,1 , ' C u C v u v C u C v C v C u                               

1 2 1 2 2 1 2 1 2 2 1 1

1 , ' , ' ' ' , 1 , ,1 C v C v C v C C v C C v C C v C v v v C C         

slide-16
SLIDE 16

Avoiding Solving Case 4

  • Case 4 occurs only when the minimum distance
  • ccurs 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

slide-17
SLIDE 17

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

17

 

 

2 1 1 2

1 2

, max max min ,max min

H q C p C p C q C

D C C p q p q

   

  

slide-18
SLIDE 18

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

slide-19
SLIDE 19

General Geometric Pruning Method for Computing One-Sided Hausdorff Distnace

  • Given two curves C1(u) and C2(v), we want to

compute the squared one-sided Hausdorff distance from C1(u) to C2(v):

  • where

   

 

    

1 1 2 0,1 0,1

, max min ,

v u

H C u C v S u v

 

         

1 2 1 2

, , S u v C u C v C u C v   

19

slide-20
SLIDE 20

Properties used for Geometric Pruning

  • Property #1:
  • The case where the Hausdorff distance occurs at

two end points is detected using this property

 

  

  

  

    

 

 

1 1 2 0,1 0,1

, , , min , , max ,

v u

H C u C v S u v S u v S u v S u v S u v

 

        

20

slide-21
SLIDE 21

Properties used for Geometric Pruning – cont.

  • Property #2:
  • Property #3:
  • The above properties detect the case where the

Hausdorff distance occurs at one end point

21

   

  

    

 

  

1 1 2 0,1 0,1

0,1 : , min , , max ,

v u

u S u v S u v H C u C v S u v

 

    

   

  

    

 

  

1 1 2 0,1 0,1

0,1 : , max , , min ,

v u

v S u v S u v H C u C v S u v

 

    

slide-22
SLIDE 22

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

22

  

    

 

  

1 1 2 0,1 0,1

min , , max ,

v u

S u v H C u C v S u v

 

 

slide-23
SLIDE 23

Bounding for the Geometric Pruning – Remark

  • We have

– Where u(v) and v(u) are functions in v and u – For the case of two Bezier Curves – In B-Spline Cases, u(v) and v(u) can be set as piecewise linear functions

23

 

 

 

   

 

 

 

 

1 1 2 0,1 0,1

min , , max ,

v u

S u v v H C u C v S u v u

 

 

   

u v v v u u  

  

    

 

  

1 1 2 0,1 0,1

min , , max ,

v u

S u v H C u C v S u v

 

 

slide-24
SLIDE 24

Geometric Pruning – Subdivision

  • When all of the properties are not satisfied, the

curve C1(u) should be divided to obtain:

  • For each v, if the Hausdorff distance cannot occur

in the interval Li, then it can be eliminated

24

   

 

 

 

 

 

 

1 1 2 1 2 1 1 2 1

max , , , ,

L R

H C H C u C H C u v u C C 

slide-25
SLIDE 25

Elimination Criteria for the Case of Two B-Splines Curves

  • Given two B-Spline curves

– – m-th and n-th degree B-spline basis functions over the knot vectors:

  • We obtain:

25

       

 

1 2

, 0,1

i j i n j m i j

C u PB u C v Q B v u v   

 

   

,

i j n m

B u B v

n+1 n+1 m+1 m+1 2 3 2 3

0,...,0 1,...,1 { , , ,..., } 0,...,0 1,... , { , , ,..., , ,1 }

n m

V U a a a b b b  

     

1 2

, 2 2

,

n m r k r k n m r k

S u v D B u B v

 

 

slide-26
SLIDE 26

Elimination Criteria for the Case of Two B-Splines Curves – cont.

  • Suppose the different knots in the knot vector U

are

  • The interval [0,1] can be partitioned into l sub-

intervals

  • The function S(u,v) can be represented in Bezier

form as:

26

, 0...

i m

u i l 

1

, , 0... 1

i i m m i

u u i l

  L     

   

 

   

2

2 2 2 1 ,

ˆ ,

m n i r k r k n i m i r k i m i i m m

S u v F B u u u u t u B v t u

  

   



slide-27
SLIDE 27

Elimination Criteria for the Case of Two B-Splines Curves – cont.

  • When the function S(u,v) is in the Bezier form in

the sub-interval Li, we subdivide at the middle to

  • btain two new intervals:
  • Theorem: If

the Hausdorff distance occurs in and the interval can be eliminated

27

 

2 2 , , ,

: 0,..., 1| 0,...,

i r r k i n k

F r n k m F

   

1

,

i m m

u u

 

    ,

i m m

u u    

1

,

i m m

u u

 

    ,

i m m

u u    

slide-28
SLIDE 28

Termination Conditions for the Subdivision Process

  • Let
  • Given a value of u, there exist a value of v such

that

  • When C1(u) & C2(v) are C1-continuous B-Spline

curves d(u) is also C1-continuous except for a finite number of locations

28

 

  

 

0,1

min , , 0,1

v

d u S u v u

 

   

 

, d u S u v u 

slide-29
SLIDE 29

Termination Conditions for the Subdivision Process – cont.

  • If the derivative of v(u) exists, then
  • Otherwise:
  • Finally, we set:

29

   

 

, d u S u v u 

     

 

   

 

     

 

 

2 1 1 2 1 1 2

' ' · ' ' 2 , ' 2 , C u C v u v d u C u C v u C u u C C u v u     

   

 

 

 

1 2 2

, ' C u C v u C v u  

               

1 2 1 1 1 2 1 2 2 1

' 2 , ' ' 2 , ' d u C u C v C u v v d u C u C v C u

 

    

     

 

+ _

' max ' , ' d u d u d u 

slide-30
SLIDE 30

Termination Conditions for the Subdivision Process – cont.

  • From the following approximation formula:
  • A trivial termination condition for a sub interval

could be simply set as:

30

 

1 2

, 0,1

t t

u u     

     

' · d u d u u d u u     

2 1 2 1

2 ' 2

t t t t

u u u u d         

slide-31
SLIDE 31

Termination Conditions for the Subdivision Process – cont.

  • When the termination condition is satisfied, the

Hausdorff distance can be approximated by the minimum distance between the point and the curve C2(v)

31

2 1 2 1

2 ' 2

t t t t

u u u u d         

1 2 1

2

t t

u u C       

slide-32
SLIDE 32

Algorithm Steps

1. Compute S(u,v) in B-Spline Form: 2. Put (S(u,v), L1, L2) into W 3. If the set W is empty go to step 8 4. Pop one element w = (S1, w1, w2) from set W 5. If S1 satisfies the elimination criteria, then go back to step 3; otherwise go to step 6 6. If the length of w1 is small enough to satisfy the termination condition, put (S1, w1, w2) into y and rerun to step 3. Otherwise go to step 7 7. Subdivide the interval w1 into two sub- intervals and put the new pairs (S11, w11, w21) & (S12, w12, w22) into set W ; return to step 3 8. For each element w of set y, compute the corresponding solution of case 3 in the region w1xw2 using the Newton-Raphson method 9. Put the solution with the maximum distance and the place where the Hausdorff distance occurs as the resulting output

32

             

1 1 1 2 2 2

' , , 0,1 , ' C u C v u v C u C v C v C u     

     

1 2

, 2 2

,

n m r k r k n m r k

S u v D B u B v

 

 

slide-33
SLIDE 33

Algorithm Results

  • For two cubic Bezier curves defined by the

control polygons:

– {(193, 226), (227, 230), (297, 134), (421, 135)} – {(258, 481), (294, 438), (302, 268), (435, 213)}

  • The Hausdorff distance is 261.9
  • The Hausdorff pair (0.0685, 0)

33