28
TEL-AVIV UNIVERSITY FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric Average of Two Simple Polygons Shay Kels Nira Dyn Evgeny Lipovetsky

TEL-AVIV UNIVERSITY FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric Average of Two Simple Polygons

Embed Size (px)

Citation preview

Page 1: TEL-AVIV UNIVERSITY FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric Average of Two Simple Polygons

TEL-AVIV UNIVERSITYFACULTY OF EXACT SCIENCES

SCHOOL OF MATHEMATICAL SCIENCES

An Algorithm for the Computation of the Metric Average of Two Simple Polygons

Shay KelsNira Dyn

Evgeny Lipovetsky

Page 2: TEL-AVIV UNIVERSITY FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric Average of Two Simple Polygons

Approximation of set-valued functions (N. Dyn, E. Farkhi, A. Mokhov)

• Given a binary operation between sets, many tools from approximation theory can be adapted to set-valued functions

Spline subdivision schemes

Bernstein operators via de Casteljau algorithm

Schoenberg operators via de Boor algorithm

• The applied operation is termed the metric average (Z. Artstein )

• Repeated computations of the metric average are required.

• Approximation of a set-valued function from a finite number of its samples

Page 3: TEL-AVIV UNIVERSITY FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric Average of Two Simple Polygons

Outline

• Extension to compact sets that are collections of simple polygons with holes.

• An algorithm that applies tools from computational geometry: segment Voronoi diagrams and planar arrangements to the computation of the metric average of two simple polygons

• Implementation of the algorithm as a C++ software using CGAL – Computational Geometry Algorithms Library• Connectedness and complexity of the metric average.

Page 4: TEL-AVIV UNIVERSITY FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric Average of Two Simple Polygons

Preliminary definitions

Let be the collection of nonempty compact subsets of .

The linear Minkowksi combination of two sets is

The Euclidean distance from a point p to a set is

The Hausdorff distance between two sets is

The set of all projections of a point p on a set is

nK nR

nKA . : min,dist AqqpAp

. distsup,dist supmax,haus

q,A

Bqp,B

ApBA

nKBA ,

nKA . ),(dist : )( ApqpAqpA

nKBA ,

, , : BqApqpBA .,for R

Page 5: TEL-AVIV UNIVERSITY FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric Average of Two Simple Polygons

The metric average

Let and the one-sidedt-weighted metric average of A and B is

nKBA , 10 t

. : )()1( ),( AxxtxtBAM Bt

The metric average of A and B is

. ),(),( 1 ABMBAMBA ttt

Example in :

BAstBABA st , haus , haus The metric property:

2R

Page 6: TEL-AVIV UNIVERSITY FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric Average of Two Simple Polygons

Conic polygons with holes

022 feydxcxybyax

A conic segment is defined by:

its base conic:

its beginning point

its end point

bp

ep

bp

ep

A simple conic polygon is a region of the plane bounded by a single finite chain of conic segments, that intersect only at their endpoints.

A simple conic polygon with holes is a conic polygon that contains holes, whichare simple conic polygons.

Page 7: TEL-AVIV UNIVERSITY FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric Average of Two Simple Polygons

Planar arrangements

is the arrangement produced by edges from and .

21 CCA 1C

2C

Given a collection C of curves in the plane, the arrangement of C is the subdivision of the planeinto vertices, edges and faces

induced by the curves in C.

The overlay of two arrangements and 1CA 2CA

Page 8: TEL-AVIV UNIVERSITY FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric Average of Two Simple Polygons

Segment Voronoi diagrams

• A segment is represented as three objects: an open segment and the endpoints.

• The diagram is bounded by a frame.

• All edges are conic segments.

• The diagram constitutes of an arrangement of conic segments.

• For a set S of n simple geometric objects (called sites) , the Voronoi diagram of S is the subdivision of the plane into regions (called faces), each region being associated with some site , and containing all points of the plane for which is closest among allthe sites in S.

Ssi is

Page 9: TEL-AVIV UNIVERSITY FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric Average of Two Simple Polygons

Computation of the metric average - the algorithm

Computation of where A, B are simple polygons

BA t

1. Compute the sets , BA , \ BA AB \

2. Compute BBAM t ,\

3. Compute AABM t ,\

AABMBBAMBA tt ,\,\ 14. Compute

. ,\,\ 1 AABMBBAMBABA ttt

The metric average can be written as:

Page 10: TEL-AVIV UNIVERSITY FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric Average of Two Simple Polygons

Computation of the metric average - the metric faces

• Let A, B be simple polygons and let F be

a Voronoi face of VDB , we call a connected component of as a metric face originating from F.

BAF \

• The metric faces are faces of the overlay of the arrangements representing VDB

and A \ B, which are intersection of the bounded faces of the two original arrangements.

• Each metric face “inherits” the Voronoi site of the face of VDB that contains it.

Page 11: TEL-AVIV UNIVERSITY FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric Average of Two Simple Polygons

Computation of the metric average - the metric faces(1)

. ,, FSFMBFM tt

is FSFM t , The region bounded by , FSFM t

, )( pp FSB

thus

The transform is a continuous and one-to-one function from F to .

pttpp FS 1

2R

We can compute the metric average only for boundaries of the metric faces and only relative to the corresponding Voronoi sites.

FpBy definition of the Voronoi diagram, for

Page 12: TEL-AVIV UNIVERSITY FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric Average of Two Simple Polygons

Computation of the one-sided metric average BBAM t ,\

1. Compute the segment Voronoi diagram induced by B

2 . Overlay with and obtain the metric faces with their corresponding sites

BA \ BVD

3. For each metric face in the collection found in 2, compute FSFM t ,

Computation of the metric average - the algorithm (1)

Page 13: TEL-AVIV UNIVERSITY FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric Average of Two Simple Polygons

Computation of the metric average - the algorithm (2)

Computation of for a metric face F

FSFM t ,

1. For each conic segment in a. compute b. add the result of (a) to the collection of conic segments already computed

F FSM ,

S

F

FSFM t ,2. Return the resulting collection of conic segments as boundary of a conic polygon ( i.e. we computed ) FSFM t ,

Page 14: TEL-AVIV UNIVERSITY FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric Average of Two Simple Polygons

Computation of the metric average - the algorithm (3)

Computation of for a conic segment and the corresponding point Voronoi site S

SM t ,

111 , yxp

yxp ,

00 , yxS

SM t ,

is the set of points satisfying SM t , yxp ,

, 11

tt

Sp

pp

where and are collinear. 1p Spp ,,1

1. Express in terms of p and S1p2. Substitute into the conic equation of

,01112

12

1 feydxcxybyax1p

and by collecting the terms obtain the conic equation of SM t ,

For a segment Voronoi site S, compute

and the computation is similar. , 0 pp S

t1

t

Page 15: TEL-AVIV UNIVERSITY FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric Average of Two Simple Polygons

Complexity bounds

Proposition: Let A,B be simple polygons and let n be the sum of the number of vertices in A and the number of vertices in B. Let k be the combinatorial complexity (the sum of the number of vertices, the number of edges, and the number of faces) of the overlay of the arrangements representing the sets and .

• The combinatorial complexity of with is

AVDBA ,,

BVD

Then:• k is .

. kO 1,0t 2nO

• Then the run-time complexity of the computation of the metric average is .

BA t

BA t nknO log

Page 16: TEL-AVIV UNIVERSITY FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric Average of Two Simple Polygons

Examples

The metric average of two simple convex polygons with 5.0t

Page 17: TEL-AVIV UNIVERSITY FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric Average of Two Simple Polygons

Examples (1)

The metric average of two simple polygons with 5.0t

Page 18: TEL-AVIV UNIVERSITY FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric Average of Two Simple Polygons

Connectedness of the metric average

The metric average of two intersecting simple polygons can be a union of several disjoin conic polygons.

The connectedness problem is model by a graph.

Vertices:- connected components of

BA- metric faces of BA \

- metric faces of AB \

Page 19: TEL-AVIV UNIVERSITY FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric Average of Two Simple Polygons

Connectedness of the metric average (1)

\ of face metric a is ,

\ of face metric a is ,

ofcomponent connected a is

1 ABFFSFM

BAFFSFM

BAFF

t

tt

are called metric connected if and only if the set is connected.

21 FF tt

21, FF

There is an edge on the graph between each twovertices corresponding to metric connected elements.

is connected iff the metric connectivity graph is connected

BA t

Page 20: TEL-AVIV UNIVERSITY FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric Average of Two Simple Polygons

Connectedness of the metric average (2)

Several propositions considering metric connectedness, for example:Proposition: Let be simple polygons and be metric faces , . are metric connected if and only if there are points and , satisfying: and .

BA, 21, FF

BFAF 21 , 21, FF11 Fp 22 Fp

211 ppFS 122 ppFS

In terms of metric faces and the corresponding Voronoi sites:

condition 1 condition 2 condition 3

Page 21: TEL-AVIV UNIVERSITY FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric Average of Two Simple Polygons

The metric average of two simple polygonal sets

A set consisting of pairwise disjoint polygons with holes is termed a simple polygonal set.

The segment Voronoi diagram induced by the boundary of a simple polygonal set is well defined.

Let be simple polygonal sets and F a face of , a connected component of is termed a metric face originating from F.

BA,

BVD BAF \

The metric faces are conic polygons with holes.

Page 22: TEL-AVIV UNIVERSITY FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric Average of Two Simple Polygons

The metric average of two simple polygonal sets (1)

Let the metric face F be a conic polygon P with holes . nHH ,...1

The operation isa continuous and one-to-one function fromF to

pttpp FS 1

. 2R

is a conic polygon FSFM t , FSPM t , . ,,...,,1 FSHMFSHM ntt

F

FS

FSFM t ,

The computation is similar to the computation of the metric average and the modified metric average of two simple polygons.

with holes

The implementation is supported by CGAL.

Page 23: TEL-AVIV UNIVERSITY FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric Average of Two Simple Polygons

Examples

, where A is a polygon and B consists of two polygons contained in A.

BA 2/1

Page 24: TEL-AVIV UNIVERSITY FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric Average of Two Simple Polygons

Examples (1)

BA 2/1 ,where A, B are simple polygonal sets.

Page 25: TEL-AVIV UNIVERSITY FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric Average of Two Simple Polygons

Future work

• An algorithm for the computation of the metric average of two-dimensional compact sets with boundaries consisting of spline curves

• An algorithm for the computation of the metric average oftwo polyhedra.

• Work in progress: new set averaging operation with superior geometric features and the ‘metric property’ relative to the measure of the symmetric difference distance

• Research for new set averaging operations with the ‘metric property’ relative to some distance

Page 26: TEL-AVIV UNIVERSITY FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric Average of Two Simple Polygons

References

• Z. Artstein, “Piecewise linear approximation of set valued maps”, Journal of Approximation Theory, vol. 56, pp. 41-47, 1989.

• F. Aurenhammer, R Klein, "Voronoi Diagrams" in Handbook of Computational Geometry, J. R. Sack, J. Urrutia, Eds., Amsterdam: Elsevier, 2000, pp. 201-290.

  • N. Dyn, E. Farkhi, A. Mokhov, “Approximation of univariate set-

valued functions - an overview”, Serdica, vol. 33, pp. 495-514, 2007.

• D. Halperin, "Arrangements", in Handbook of Discrete and Computational Geometry, J. E. Goodman, J. O’Rourke, Eds., Chapman & Hall/CRC, 2nd edition, 2004, pp 529–562.

• The CGAL project homepage. http://www.cgal.org/.

Page 27: TEL-AVIV UNIVERSITY FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric Average of Two Simple Polygons

Appendix A: Computation of the metric average with Voronoi diagrams – the mathematics

, \\ BVDF

FBABA

Let A, B be simple polygons, the set A\ B can be written as

. ,\,\ BVDF

tt BFBAMBBAM

and therefore

, )(FSqpq B

For a point p on the interior of a Voronoi face F

. nR(*) and (**) can be extended to any two compact sets A, B in

, ,\,\ BVDF

tt FSFBAMBBAM

therefore

(*)

or in terms of metric faces

. ,,\)\(

BABMFFtt FSFMBBAM

(**)

Page 28: TEL-AVIV UNIVERSITY FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric Average of Two Simple Polygons

Appendix A: Computation of the metric average with Voronoi diagrams – the mathematics (1)

For a site S(F) of the segment Voronoi diagram and a point p in R2

the set is a singleton. pFS

can be regarded as a function

which is continuous and one-to-one. )()1( pttpp FS 2: RFG

The boundary of a metric face is a simple closed curve, so is its

mapping under G, and therefore

stands for the region bounded by . ,, FSFMFSFM tt

BA tThe metric average can be computed as

, ,\,\ 1 AABMBBAMBABA ttt where

. ,,\)\(

BABMFFtt FSFMBBAM