CS133 Computational Geometry Simplification Algorithms 1 Line - - PowerPoint PPT Presentation

β–Ά
cs133
SMART_READER_LITE
LIVE PREVIEW

CS133 Computational Geometry Simplification Algorithms 1 Line - - PowerPoint PPT Presentation

CS133 Computational Geometry Simplification Algorithms 1 Line Simplification ? 2 Line Simplification Given a line string and a distance threshold , return a simplified line string such that any point in the input line string is not


slide-1
SLIDE 1

CS133

Computational Geometry

Simplification Algorithms

1

slide-2
SLIDE 2

Line Simplification

2

?

slide-3
SLIDE 3

Line Simplification

Given a line string and a distance threshold 𝜁, return a simplified line string such that any point in the input line string is not displaced more than 𝜁

3

slide-4
SLIDE 4

Douglas–Peucker Algorithm

4

≀ 𝜁

slide-5
SLIDE 5

Douglas–Peucker Algorithm

5

≀ 𝜁

slide-6
SLIDE 6

Douglas–Peucker Algorithm

6

slide-7
SLIDE 7

Douglas–Peucker Algorithm

7

≀ 𝜁

slide-8
SLIDE 8

Douglas–Peucker Algorithm

8

≀ 𝜁

slide-9
SLIDE 9

Douglas–Peucker Algorithm

9

≀ 𝜁

slide-10
SLIDE 10

Douglas–Peucker Algorithm

10

≀ 𝜁

slide-11
SLIDE 11

Douglas–Peucker Algorithm

11

slide-12
SLIDE 12

Douglas–Peucker Algorithm

12

slide-13
SLIDE 13

Douglas–Peucker Algorithm

13

slide-14
SLIDE 14

Running Time

function DouglasPeucker(P[], 𝜁) // Find the point with the maximum distance (=maximum cross product) cmax = 0 index = 0 for i = 2 to ( end - 1) c = 𝑄 1 𝑄[π‘œ] Γ— 𝑄 1 𝑄[𝑗] if ( c > cmax ) index = i cmax = c if (cmax / 𝑄 1 [𝑄 π‘œ > 𝜁) { R1 = DouglasPeucker(P[1..index], 𝜁) R2 = DouglasPeucker(P[index..n], 𝜁) R1.removeLast return R1 || R2 // Concatenate the two lists else return [P[1], P[n]] // Only return the first and last points

14

π‘ˆ π‘œ = π‘ˆ π‘œ1 + π‘ˆ π‘œ βˆ’ π‘œ1 + 𝑃 π‘œ

slide-15
SLIDE 15

Polygon Triangulation

15

slide-16
SLIDE 16

Polygon Triangulation

Given a simple polygon P, break it down into a set of triangles π‘ˆ such that the union of the triangles is equal to the polygon and no two triangles intersect. That is: Ϊ‚π‘’π‘—βˆˆπ‘ˆ 𝑒𝑗 = 𝑄 and 𝑒𝑗 ∩ π‘’π‘˜ = 𝜚 for any 𝑒𝑗, π‘’π‘˜ ∈ π‘ˆ and 𝑗 β‰  π‘˜

16

slide-17
SLIDE 17

Polygon Triangulation

17

slide-18
SLIDE 18

Convex Polygons

Choose any vertex

  • n the polygon

Connect it to all

  • ther vertices to

create all diagonals Number of possible triangulations is Catalan Number π·π‘œβˆ’2

π·π‘œ =

1 π‘œ+1

2π‘œ π‘œ =

2π‘œ! π‘œ+1 !π‘œ!

18

By Eric DΓ©trez (as published at www.texample.net in 2008-10-09) - The image is the result of a latex script example published at [1]. All the site is under CC-2.5-by license, as seen on every page of the wite., CC BY 2.5, https://commons.wikimedia.org/w/index.php?curid=56872963

slide-19
SLIDE 19

Number of Triangles

Number of triangles in a triangulation of a polygon of π‘œ points is π‘œ βˆ’ 2 triangles Can be proven by induction Trivial case: π‘œ = 3 General case: If it applies for all π‘œ < 𝑛, we need to prove that it applies for π‘œ = 𝑛 That is, we want to prove that if a triangulation exists, it will have 𝑛 βˆ’ 2 triangles

19

slide-20
SLIDE 20

Induction

π‘œ1 + π‘œ2 = 𝑛 + 1 # of triangles in 𝑄

1 = π‘œ1 βˆ’ 2, in 𝑄2 = π‘œ2 βˆ’ 2

# of triangles in 𝑄 = π‘œ1 βˆ’ 2 + π‘œ2 βˆ’ 2 + 1 = π‘œ1 + π‘œ2 βˆ’ 4 + 1 = 𝑛 + 1 βˆ’ 4 + 1 = 𝑛 βˆ’ 2

20

π‘œ1 π‘œ2

slide-21
SLIDE 21

Existence of a Triangulation

Any simple polygon has at least one triangulation Proof by induction Trivial case: π‘œ = 3 General case: If there are triangulations for all polygons π‘œ < 𝑛, we need to prove that there is one for π‘œ = 𝑛

21

slide-22
SLIDE 22

Induction

22

slide-23
SLIDE 23

Dual Graph

Dual graph 𝒣 Each triangle is represented by a vertex in 𝒣 Two triangles that share an edge are connected by an edge in 𝒣

23