Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick...

95
GEOMETRY P Bhowmick Computational and Digital Geometry Convex Hulls and Ortho-convex Hulls Partha Bhowmick Associate Professor Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur India NIT Durgapur 23 Jan 2014

Transcript of Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick...

Page 1: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick Computational and Digital GeometryConvex Hulls and Ortho-convex Hulls

Partha BhowmickAssociate Professor

Department of Computer Science and EngineeringIndian Institute of Technology, Kharagpur

India

NIT Durgapur 23 Jan 2014

Page 2: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Convex hull

Input: Point set P on xy-plane.

Page 3: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Convex hull

convex hullOutput: Convex hull, CP = a sequence of vertices/edges.

Page 4: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Convex hull

Edge of CP ?

Page 5: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Convex hull

Left 6= empty

Right 6= empty

No, it’s not an edge of CP .

Page 6: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Convex hull

Yes, it’s an edge of CP .

Right = empty

Page 7: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Convex hull

|P | = n⇒ O(n2) pairs ⇒ O(n3) time

Page 8: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Convex hull

|CP | = O(n): O(n3) time is quite high!

Page 9: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Better observations

pL pR

Obs 1The leftmost point pL and the rightmost point pR of P formthe leftmost and the rightmost vertices of CP .

Page 10: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Better observations

pL pR

Obs 2Clockwise traversal along the boundary of CP always yields aright turn at each vertex of CP .

Page 11: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Better observations

The clueUse turn type to decide whether a triplet of points forms apair of consecutive edges of CP .

But how?We have O(n3) triplets of points!We can avoid checking so many triplets if we use incrementalapproach.

Page 12: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Better observations

A questionLet CP,i = vertices of upper hull up to pi.Then what’s the relation between CP,i+1 and CP,i?

pRpi

pi+1

CP,i

pL

Page 13: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Better observations

The answerCP,i+1 ⊆ CP,i ∪ {pi+1}.It’s a strong observation ⇒ Incremental algorithm!

pRpL pi

CP,i+1

pi+1

Page 14: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Incremental algorithm: Graham scan

pL pR

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

pL pR

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

After lexicographic sorting(x = primary key, y = secondary key)

Page 15: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Incremental algorithm: Graham scan

pL pRpL pR

1

2

4

5

6

7

8

9

10

11

12

13

14

15

3

R

Page 16: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Incremental algorithm: Graham scan

pL pR

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

pL pR

1

2

5

6

7

8

9

10

11

12

13

14

15

3

4

L

not in CP

Page 17: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Incremental algorithm: Graham scan

pL pR

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

pL pR

1

2

5

6

7

8

9

10

11

12

13

14

15

3

4

R

Page 18: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Incremental algorithm: Graham scan

pL pR

1

2

3

4

6

7

8

9

10

11

12

13

14

15

pL pR

1

2

6

7

8

9

10

11

12

13

14

15

3

4

55R

Page 19: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Incremental algorithm: Graham scan

pL pR

1

2

3

4

7

8

9

10

11

12

13

14

15

pL pR

1

2

7

8

9

10

11

12

13

14

15

3

4

66

55L

Page 20: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Incremental algorithm: Graham scan

pL pR

1

2

3

7

8

9

10

11

12

13

14

15

pL pR

1

2

7

8

9

10

11

12

13

14

15

3

4

66

55

L

Page 21: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Incremental algorithm: Graham scan

pL pR

1

2

3

7

8

9

10

11

12

13

14

15

pL pR

1

2

7

8

9

10

11

12

13

14

15

3

4

66

55

R

Page 22: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Incremental algorithm: Graham scan

pL pR

1

2

3

7

8

9

10

11

12

13

14

15

pL pR

1

2

7

8

9

10

11

12

13

14

15

3

4

66

55

R

Page 23: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Incremental algorithm: Graham scan

pL pR

1

2

3

7

8

9

10

11

12

13

14

15

pL pR

1

2

7

8

9

10

11

12

13

14

15

3

4

66

55

L

Page 24: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Incremental algorithm: Graham scan

pL pR

1

2

3

7

8

9

10

11

12

13

14

15

pL pR

1

2

7

8

9

10

11

12

13

14

15

3

4

66

55

R

Page 25: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Incremental algorithm: Graham scan

pL pR

1

2

3

7

8

9

10

11

12

13

14

15

pL pR

1

2

7

8

9

10

11

12

13

14

15

3

4

66

55

R

Page 26: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Incremental algorithm: Graham scan

pL pR

1

2

3

7

8

9

10

11

12

13

14

15

pL pR

1

2

7

8

9

10

11

12

13

14

15

3

4

66

55

R

Page 27: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Incremental algorithm: Graham scan

pL pR

1

2

3

7

8

9

11

12

13

14

15

pL pR

1

2

7

8

9

10

11

12

13

14

15

3

4

66

55

L

Page 28: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Incremental algorithm: Graham scan

pL pR

1

2

3

7

8

9

11

12

13

14

15

pL pR

1

2

7

8

9

10

11

12

13

14

15

3

4

66

55

L

Page 29: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Incremental algorithm: Graham scan

pL pR

1

2

3

7

8

9

11

12

13

14

15

pL pR

1

2

7

8

9

10

11

12

13

14

15

3

4

66

55

R

Page 30: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Incremental algorithm: Graham scan

pL pR

1

2

3

7

8

9

12

13

14

15

pL pR

1

2

7

8

10

11

12

13

14

15

3

4

66

55L

Page 31: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Incremental algorithm: Graham scan

pL pR

1

2

3

7

8

9

12

13

14

15

pL pR

1

2

7

8

10

11

12

13

14

15

3

4

66

55

L

Page 32: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Incremental algorithm: Graham scan

pL pR

1

2

3

7

9

12

13

14

15

pL pR

1

2

7

8

10

11

12

13

14

15

3

4

66

55

R

Page 33: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Incremental algorithm: Graham scan

pL pR

1

2

3

7

9

12

13

14

15

pL pR

1

2

7

8

10

11

12

13

14

15

3

4

66

55

R

Page 34: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Incremental algorithm: Graham scan

pL pR

1

2

3

7

9

12

14

15

pL pR

1

2

7

8

10

11

12

13

14

15

3

4

66

55

L

Page 35: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Incremental algorithm: Graham scan

pL pR

1

2

3

7

9

14

15

pL pR

1

2

7

8

10

11

12

13

14

15

3

4

66

55

L

Page 36: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Incremental algorithm: Graham scan

pL pR

1

2

3

7

9

14

15

pL pR

1

2

7

8

10

11

12

13

14

15

3

4

66

55

R

Page 37: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Incremental algorithm: Graham scan

pL pR

1

2

3

7

9

14

15

pL pR

1

2

7

8

10

11

12

13

14

15

3

4

66

55

R

Page 38: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Incremental algorithm: Graham scan

pL pR

1

2

3

7

9

14

15

pL pR

1

2

7

8

10

11

12

13

14

15

3

4

66

55

Page 39: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Incremental algorithm: Graham scan

pL pR

1

2

3

7

9

14

15

pL pR

1

2

7

8

10

11

12

13

14

15

3

4

66

55

Page 40: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Time complexity

pi

CP,i+1

pi+1CP,i

Let pj ∈ CP,i.If pj 6∈ CP,i+1, then pj 6∈ CP,i+2, pj 6∈ CP,i+3, . . . , pj 6∈ CP,n,since CP,i+1 ⊆ CP,i ∪ {pi+1}.So, once pj is removed from the upper hull, it’s neverreconsidered.

Page 41: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Time complexity

pi

CP,i+1

pi+1CP,i

Let pj ∈ CP,i.If pj 6∈ CP,i+1, then pj 6∈ CP,i+2, pj 6∈ CP,i+3, . . . , pj 6∈ CP,n,since CP,i+1 ⊆ CP,i ∪ {pi+1}.So, once pj is removed from the upper hull, it’s neverreconsidered.

Page 42: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Time complexity

pi

CP,i+1

pi+1CP,i

Let pj ∈ CP,i.If pj 6∈ CP,i+1, then pj 6∈ CP,i+2, pj 6∈ CP,i+3, . . . , pj 6∈ CP,n,since CP,i+1 ⊆ CP,i ∪ {pi+1}.So, once pj is removed from the upper hull, it’s neverreconsidered.

Page 43: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Time complexity

pi

CP,i+1

pi+1CP,i

Let pj ∈ CP,i.If pj 6∈ CP,i+1, then pj 6∈ CP,i+2, pj 6∈ CP,i+3, . . . , pj 6∈ CP,n,since CP,i+1 ⊆ CP,i ∪ {pi+1}.So, once pj is removed from the upper hull, it’s neverreconsidered.

Page 44: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Time complexity

pi

CP,i+1

pi+1CP,i

Let pj ∈ CP,i.If pj 6∈ CP,i+1, then pj 6∈ CP,i+2, pj 6∈ CP,i+3, . . . , pj 6∈ CP,n,since CP,i+1 ⊆ CP,i ∪ {pi+1}.So, once pj is removed from the upper hull, it’s neverreconsidered.

Page 45: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Time complexity

pi

CP,i+1

pi+1CP,i

Data structure: Stack, whose top = pi.If top two vertices in stack and pi+1 do not form a right turnat pi, then pi is popped out for ever!⇒ #pushes = n and #pops < n⇒ T (n) = O(n) ← no best, average, or worst case!For lexicographic sorting, it takes O(n log n) time.

Page 46: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Time complexity

pi

CP,i+1

pi+1CP,i

Data structure: Stack, whose top = pi.If top two vertices in stack and pi+1 do not form a right turnat pi, then pi is popped out for ever!⇒ #pushes = n and #pops < n⇒ T (n) = O(n) ← no best, average, or worst case!For lexicographic sorting, it takes O(n log n) time.

Page 47: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Time complexity

pi

CP,i+1

pi+1CP,i

Data structure: Stack, whose top = pi.If top two vertices in stack and pi+1 do not form a right turnat pi, then pi is popped out for ever!⇒ #pushes = n and #pops < n⇒ T (n) = O(n) ← no best, average, or worst case!For lexicographic sorting, it takes O(n log n) time.

Page 48: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Time complexity

pi

CP,i+1

pi+1CP,i

Data structure: Stack, whose top = pi.If top two vertices in stack and pi+1 do not form a right turnat pi, then pi is popped out for ever!⇒ #pushes = n and #pops < n⇒ T (n) = O(n) ← no best, average, or worst case!For lexicographic sorting, it takes O(n log n) time.

Page 49: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Time complexity

pi

CP,i+1

pi+1CP,i

Data structure: Stack, whose top = pi.If top two vertices in stack and pi+1 do not form a right turnat pi, then pi is popped out for ever!⇒ #pushes = n and #pops < n⇒ T (n) = O(n) ← no best, average, or worst case!For lexicographic sorting, it takes O(n log n) time.

Page 50: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Reference of Algorithms

1 Incremental — O(n logn) . n = #pointsR. Graham, An Efficient Algorithm for Determining the ConvexHull of a Finite Point Set, Info. Proc. Letters, 1, pp. 132–133,1972.

2 Gift wrapping — O(nh) . h = #hull verticesR. A. Jarvis, On the Identification of the Convex Hull of a FiniteSet of Points in the Plane, Info. Proc. Letters, 2, pp. 18–21, 1973.

3 Divide and Conquer — O(n logn)F. P. Preparata and S. J. Hong, Convex Hulls of Finite Sets ofPoints in Two and Three Dimensions, Commun. ACM, 20,pp. 87–93, 1977.

4 Marriage before Conquest — O(n log h)D. G. Kirkpatrick and R. Seidel, The Ultimate Planar ConvexHull Algorithm?, SIAM J. Comput., 15, pp. 287–299, 1986.

5 Simpler optimal output-sensitive — O(n log h)T. M. Chan, Optimal Output-Sensitive Convex Hull Algorithmsin Two and Three Dimensions, Discrete & ComputationalGeometry, 16, pp. 361–368, 1996.

Page 51: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Convex hull of a polygon

Page 52: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Linear-time algorithms

1 1979 McCallum-Avis, IPL

2 1983 Lee, Intl. J. Computers & Info. Sc.

3 1983 Graham-Yao, J. Algorithms

4 1983 ElGindy-Avis-Toussaint, Computing

5 1984 Bhattacharya-ElGindy, IEEE Trans. Info. Thy.

6 1985 Preparata-Shamos, Computational Geometry, Ch. 4

7 1985 Orlowski, Pattern Rec.

8 1986 Shin-Woo, Pattern Rec.

9 1987 Melkman, IPL

Page 53: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Convex Hull versus Orthogonal Hull

Digital object(A = set/connected component of integer points)

Page 54: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Convex Hull versus Orthogonal Hull

Convex hull CA

Page 55: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Convex Hull versus Orthogonal Hull

Any straight line has at most one segment of intersection(a necessary property)

Page 56: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Convex Hull versus Orthogonal Hull

Object A imposed on a grid G of size g = 4

Page 57: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Convex Hull versus Orthogonal Hull

Orthogonal hull CA

Page 58: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Convex Hull versus Orthogonal Hull

Any horizontal or vertical line has at most one segment ofintersection (a necessary property)

Page 59: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Observations

R L

R R

R

R

R

RR

R

R

L

L

L

L

L

There are both left and right turns!(clockwise)

Page 60: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Observations

L R

L L

L

L

L

LL

L

L

R

R

R

R

R

or, both right and left turns(anticlockwise)

Page 61: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Observations

or, 900 (Type 1) and 2700 (Type 3) vertices

Page 62: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Observations

But no two consecutive Type 3 vertices

Page 63: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Observations

Two consecutive Type 3 vertices defy the necessary propertyof line intersection

Page 64: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Algorithm

Step 1: Traverse the border of isothetic cover of A

Page 65: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Algorithm

Step 2: If 33, then process to remove the concavity.

Page 66: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Algorithm

Step 2: If 33, then process to remove the concavity.

Page 67: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Algorithm

Step 2: If 33, then process to remove the concavity.

Page 68: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Algorithm

Step 2: If 33, then process to remove the concavity.

Page 69: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Combinatorial cases

13331331

Just 1331 and 1333 (= 1333+)

Page 70: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Pattern 1331 (1)

0

v0v

4l

0

l

0

2

4

4v l + l

+ l

3v2

1

v2

ll

l

1v

3

Rule R11 (l1 = l3):〈v0(t0, l0), v1(1, l1), v2(3, l2), v3(3, l3), v4(1, l4)〉 →〈v0(t0, l0 + l2 + l4)〉

Page 71: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Pattern 1331 (2)

v3

v2v

0

v

2

4l 2

l 4

l 0

1

v4

l 3

l − l

l +

l

1 3

l 0

v

v2

1 l 1

v0

Rule R12 (l1 > l3):〈v0(t0, l0), v1(1, l1), v2(3, l2), v3(3, l3), v4(1, l4)〉 →〈v0(t0, l0), v1(1, l1 − l3), v2(3, l2 + l4)〉

Page 72: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Pattern 1331 (3)

4l

4

2

3v

1l1

v

v

v

l

2v

0

2

l + l

3l3v

4l

3 1

0

l − l4

l

0

v

0v

Rule R13 (l1 < l3):〈v0(t0, l0), v1(1, l1), v2(3, l2), v3(3, l3), v4(1, l4)〉 →〈v0(t0, l0 + l2), v3(3, l3 − l1), v4(1, l4)〉

Page 73: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Pattern 1333 (1)

0

2

4

3 1 l − l

2l

2v

3l

3v

1l

0v

4l

3v4v4l

1v

0l0v

l + l

v

Rule R21 (l1 < l3):〈v0(t0, l0), v1(1, l1), v2(3, l2), v3(3, l3), v4(3, l4)〉 →〈v0(t0, l0 + l2), v3(3, l3 − l1), v4(3, l4)〉

Page 74: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Pattern 1333 (2)

(ini

t)(init)

l

Vl

1l

0

3v4

v1,2

v1,1

v1,4

= l

4l

//

v2

l 2 l − 2

// l

l 3

v

v

v0

l

/l1v

4,2v

4,1v

1,3v

2v

H 1v /l

0l 0

Let v = current vertex (under traversal).lH = horizontal line thru’ v2, lV = vertical line thru’ v4.l−H ∩ l−V = region lying below lH and left of lV .if v ∈ l−H ∩ l−V , then apply R22; else traverse ahead to get v.

Page 75: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Pattern 1333 (3)

(ini

t)(init)

l

Vl

1l

0

3v4

v1,2

v1,1

v1,4

= l

4l

//

v2

l 2 l − 2

// l

l 3

v

v

v0

l

/l1v

4,2v

4,1v

1,3v

2v

H 1v /l

0l 0

Rule R22 (l1 > l3 and d = d2):〈v0(t0, l0), v1(1, l1), v2(3, l2), v3(3, l3), v4(3, l4)〉 →〈v0(t0, l0), v1(1, l′), v2(3, l2 − l′′)〉d = direction from v, d2 = direction from v2.

Page 76: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Pattern 1333 (4)

(ini

t)

(init)

l3v

l

= l

3

l

v

2l

Vl

4v

H

//

l

0l

2

2v1 1lv

/

0

//l

v

l

1v0l

4

v

0v

3

/

if v ∈ l−H ∩ l−V , then apply R23; else traverse ahead to get v.

Rule R23 (l1 > l3 and d = d3):〈v0(t0, l0), v1(1, l1), v2(3, l2), v3(3, l3), v4(3, l4)〉 →〈v0(t0, l0), v1(1, l1 − l3), v2(3, (l2 − l′′), v3(3, (l1 − l3 − l′)〉

Page 77: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Demo

Page 78: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Demo

Page 79: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Demo

Page 80: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Demo

Page 81: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Demo

Page 82: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Time Complexity

Let n = #points on object border, g = grid size.

1 Checking object containment in a cell: O(g) time.

2 #grid points visited: O(n/g)⇒ Visiting all vertices: O(n/g) ·O(g) = O(n) time.

3 Removal of a concavity (applying Rule): O(1) time.

4 Maximum #reductions: O(n/g)− 4.⇒ Total #operations: (O(n/g)− 4) ·O(1) = O(n/g).

5 Total time complexity: O(n) +O(n/g) = O(n).

Page 83: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Time Complexity

Let n = #points on object border, g = grid size.

1 Checking object containment in a cell: O(g) time.

2 #grid points visited: O(n/g)⇒ Visiting all vertices: O(n/g) ·O(g) = O(n) time.

3 Removal of a concavity (applying Rule): O(1) time.

4 Maximum #reductions: O(n/g)− 4.⇒ Total #operations: (O(n/g)− 4) ·O(1) = O(n/g).

5 Total time complexity: O(n) +O(n/g) = O(n).

Page 84: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Time Complexity

Let n = #points on object border, g = grid size.

1 Checking object containment in a cell: O(g) time.

2 #grid points visited: O(n/g)⇒ Visiting all vertices: O(n/g) ·O(g) = O(n) time.

3 Removal of a concavity (applying Rule): O(1) time.

4 Maximum #reductions: O(n/g)− 4.⇒ Total #operations: (O(n/g)− 4) ·O(1) = O(n/g).

5 Total time complexity: O(n) +O(n/g) = O(n).

Page 85: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Time Complexity

Let n = #points on object border, g = grid size.

1 Checking object containment in a cell: O(g) time.

2 #grid points visited: O(n/g)⇒ Visiting all vertices: O(n/g) ·O(g) = O(n) time.

3 Removal of a concavity (applying Rule): O(1) time.

4 Maximum #reductions: O(n/g)− 4.⇒ Total #operations: (O(n/g)− 4) ·O(1) = O(n/g).

5 Total time complexity: O(n) +O(n/g) = O(n).

Page 86: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Time Complexity

Let n = #points on object border, g = grid size.

1 Checking object containment in a cell: O(g) time.

2 #grid points visited: O(n/g)⇒ Visiting all vertices: O(n/g) ·O(g) = O(n) time.

3 Removal of a concavity (applying Rule): O(1) time.

4 Maximum #reductions: O(n/g)− 4.⇒ Total #operations: (O(n/g)− 4) ·O(1) = O(n/g).

5 Total time complexity: O(n) +O(n/g) = O(n).

Page 87: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Time Complexity

Let n = #points on object border, g = grid size.

1 Checking object containment in a cell: O(g) time.

2 #grid points visited: O(n/g)⇒ Visiting all vertices: O(n/g) ·O(g) = O(n) time.

3 Removal of a concavity (applying Rule): O(1) time.

4 Maximum #reductions: O(n/g)− 4.⇒ Total #operations: (O(n/g)− 4) ·O(1) = O(n/g).

5 Total time complexity: O(n) +O(n/g) = O(n).

Page 88: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Time Complexity

Let n = #points on object border, g = grid size.

1 Checking object containment in a cell: O(g) time.

2 #grid points visited: O(n/g)⇒ Visiting all vertices: O(n/g) ·O(g) = O(n) time.

3 Removal of a concavity (applying Rule): O(1) time.

4 Maximum #reductions: O(n/g)− 4.⇒ Total #operations: (O(n/g)− 4) ·O(1) = O(n/g).

5 Total time complexity: O(n) +O(n/g) = O(n).

Page 89: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Result

digital object = 10541 points

Page 90: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Result

Isothetic cover

Page 91: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Result

Orthogonal hull

Page 92: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Result

g = 4, 8, 14

#vertices = 18, 16, 16

Page 93: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Result

g = 4, 8, 14

#vertices = 120, 60, 32

Page 94: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

Result

g = 4, 8, 14

#vertices = 88, 44, 32

Feature analysisConcavity strength and concavity relation

Narrow mouthed concavity

Concavity complexity

Page 95: Computational and Digital Geometrypb/convex-hull-talk-nit-dgp-2014a.pdf · GEOMETRY P Bhowmick Convex hull Algorithm Hull of Polygon Orthogonal hull Observations Algorithm Result

GEOMETRY

P Bhowmick

Convex hull

Algorithm

Hull ofPolygon

Orthogonalhull

Observations

Algorithm

Result

References

A. Biswas, P. Bhowmick, M. Sarkar, B. B. Bhattacharya, Alinear-time combinatorial algorithm to find the orthogonal hull ofan object on the digital plane, Information Sciences, 216,pp. 176–195, 2012.

A. Biswas, P. Bhowmick, B. B. Bhattacharya, Construction ofisothetic covers of a digital object: A combinatorial approach,Journal of Visual Communication and Image Representation, 21,pp. 295–310, 2010.

Thank you