counting convex k gons in an arrangement of line segments
play

Counting Convex k -gons in an Arrangement of Line Segments Martin - PowerPoint PPT Presentation

Counting Convex k -gons in an Arrangement of Line Segments Martin Fink, Neeraj Kumar and Subhash Suri University of California, Santa Barbara Motivation Consider the following problem from computer vision: Motivation Consider the following


  1. Counting Convex k -gons in an Arrangement of Line Segments Martin Fink, Neeraj Kumar and Subhash Suri University of California, Santa Barbara

  2. Motivation Consider the following problem from computer vision:

  3. Motivation Consider the following problem from computer vision: Given a camera image I representing object boundaries, estimate the number of rectangular objects in the scene.

  4. Motivation Consider the following problem from computer vision: Given a camera image I representing object boundaries, estimate the number of rectangular objects in the scene. ◮ Camera image I ⇒ Arrangement A of line segments

  5. Motivation Consider the following problem from computer vision: Given a camera image I representing object boundaries, estimate the number of rectangular objects in the scene. ◮ Camera image I ⇒ Arrangement A of line segments ◮ Perspective transformation: Rectangles in scene ⇒ quadilaterals in image

  6. Motivation Consider the following problem from computer vision: Given a camera image I representing object boundaries, estimate the number of rectangular objects in the scene. ◮ Camera image I ⇒ Arrangement A of line segments ◮ Perspective transformation: Rectangles in scene ⇒ quadilaterals in image ◮ Count all convex quadilaterals (4-gon) in an arrangement

  7. Motivation Consider the following problem from computer vision: Given a camera image I representing object boundaries, estimate the number of rectangular objects in the scene. ◮ Camera image I ⇒ Arrangement A of line segments ◮ Perspective transformation: Rectangles in scene ⇒ quadilaterals in image ◮ Count all convex quadilaterals (4-gon) in an arrangement Natural generalization to convex k -gons

  8. Problem Definition Given: An arrangement A ( S ) of line segments S in 2-D b a c d e

  9. Problem Definition Given: An arrangement A ( S ) of line segments S in 2-D b a c d e A convex k -gon of A ( S ) is a convex polygon with k sides if:

  10. Problem Definition Given: An arrangement A ( S ) of line segments S in 2-D 7 4 2 b 5 1 a 3 6 c d e A convex k -gon of A ( S ) is a convex polygon with k sides if: ◮ vertices are a subset of arrangement vertices.

  11. Problem Definition Given: An arrangement A ( S ) of line segments S in 2-D 7 4 2 b 5 1 a 3 6 c d e A convex k -gon of A ( S ) is a convex polygon with k sides if: ◮ vertices are a subset of arrangement vertices. ◮ sides are part of input segments.

  12. Problem Definition Given: An arrangement A ( S ) of line segments S in 2-D 7 4 2 b 5 k = 4 1 a 3 6 c d e A convex k -gon of A ( S ) is a convex polygon with k sides if: ◮ vertices are a subset of arrangement vertices. ◮ sides are part of input segments.

  13. Problem Definition Given: An arrangement A ( S ) of line segments S in 2-D 7 4 2 b 5 k = 4 1 a 3 6 c d e A convex k -gon of A ( S ) is a convex polygon with k sides if: ◮ vertices are a subset of arrangement vertices. ◮ sides are part of input segments. Goal: count and report all such k -gons.

  14. Our Results ◮ Count all k -gons in O ( n log n + mn ) time and O ( n 2 ) space (for constant k )

  15. Our Results ◮ Count all k -gons in O ( n log n + mn ) time and O ( n 2 ) space (for constant k ) ◮ Report set of all k -gons K in O ( | K | ) additional time and O ( mn ) additional space

  16. Our Results ◮ Count all k -gons in O ( n log n + mn ) time and O ( n 2 ) space (for constant k ) ◮ Report set of all k -gons K in O ( | K | ) additional time and O ( mn ) additional space Count in time much faster than the number of k -gons :

  17. Our Results ◮ Count all k -gons in O ( n log n + mn ) time and O ( n 2 ) space (for constant k ) ◮ Report set of all k -gons K in O ( | K | ) additional time and O ( mn ) additional space Count in time much faster than the number of k -gons : Θ( n k ) ⌊ n k ⌋

  18. Our Results ◮ Count all k -gons in O ( n log n + mn ) time and O ( n 2 ) space (for constant k ) ◮ Report set of all k -gons K in O ( | K | ) additional time and O ( mn ) additional space Count in time much faster than the number of k -gons : Θ( n k ) ⌊ n k ⌋ ◮ Counting k -gons is as hard as the 3SUM problem, for k = 3 , 4

  19. Counting k -gons A vertical line L intersects at most two sides of a k -gon P . L span( P , L ) = ( a , b )

  20. Counting k -gons A vertical line L intersects at most two sides of a k -gon P . L a P b span( P , L ) = ( a , b )

  21. Counting k -gons A vertical line L intersects at most two sides of a k -gon P . L a P b span( P , L ) = ( a , b )

  22. Counting k -gons A vertical line L intersects at most two sides of a k -gon P . L a P b span( P , L ) = ( a , b ) ◮ O ( n 2 ) distinct spans (w.r.t. L ) among all k -gons

  23. Counting k -gons A vertical line L intersects at most two sides of a k -gon P . L a P b span( P , L ) = ( a , b ) ◮ O ( n 2 ) distinct spans (w.r.t. L ) among all k -gons ◮ Suggests a plane sweep based algorithm, key idea:

  24. Counting k -gons A vertical line L intersects at most two sides of a k -gon P . L a P b span( P , L ) = ( a , b ) ◮ O ( n 2 ) distinct spans (w.r.t. L ) among all k -gons ◮ Suggests a plane sweep based algorithm, key idea: ◮ Assign a k -gon intersecting L to its span

  25. Counting k -gons A vertical line L intersects at most two sides of a k -gon P . L a P b span( P , L ) = ( a , b ) ◮ O ( n 2 ) distinct spans (w.r.t. L ) among all k -gons ◮ Suggests a plane sweep based algorithm, key idea: ◮ Assign a k -gon intersecting L to its span ◮ Update count as we sweep L across the plane

  26. Notation L a b ◮ Open j -gons : All j ≤ k sides start left of L

  27. Notation L a b ◮ Open j -gons : All j ≤ k sides start left of L

  28. Notation L a b ◮ Open j -gons : All j ≤ k sides start left of L ◮ σ ( a , b , j ) : Number of open j -gons with span ( a , b )

  29. Notation L a b σ ( a , b , 5) = 2 ◮ Open j -gons : All j ≤ k sides start left of L ◮ σ ( a , b , j ) : Number of open j -gons with span ( a , b )

  30. Notation L a b ◮ Open j -gons : All j ≤ k sides start left of L ◮ σ ( a , b , j ) : Number of open j -gons with span ( a , b ) ◮ Closed k -gons : All k sides end left of L

  31. Notation L a b count = 2 ◮ Open j -gons : All j ≤ k sides start left of L ◮ σ ( a , b , j ) : Number of open j -gons with span ( a , b ) ◮ Closed k -gons : All k sides end left of L ◮ count : number of k -gons left of L

  32. Algorithm Steps ◮ Set count = 0 and σ ( a , b , j ) = 0, for all a , b , j

  33. Algorithm Steps ◮ Set count = 0 and σ ( a , b , j ) = 0, for all a , b , j ◮ Compute all intersections (Event points)

  34. Algorithm Steps ◮ Set count = 0 and σ ( a , b , j ) = 0, for all a , b , j ◮ Compute all intersections (Event points) ◮ For each event from left to right: Perform Updates

  35. Algorithm Steps ◮ Set count = 0 and σ ( a , b , j ) = 0, for all a , b , j ◮ Compute all intersections (Event points) ◮ For each event from left to right: Perform Updates ◮ Return count

  36. Updates at intersection ( a , b ) L c a p i b d

  37. Updates at intersection ( a , b ) ◮ Some k -gons complete L c a p i b d

  38. Updates at intersection ( a , b ) ◮ Some k -gons complete ◮ count += σ ( a , b , k ) L c a p i b d

  39. Updates at intersection ( a , b ) ◮ Some k -gons complete ◮ count += σ ( a , b , k ) L ◮ A 2-gon begins c a p i b d

  40. Updates at intersection ( a , b ) ◮ Some k -gons complete ◮ count += σ ( a , b , k ) L ◮ A 2-gon begins c a ◮ σ ( b , a , 2) = 1 p i b d

  41. Updates at intersection ( a , b ) ◮ Some k -gons complete ◮ count += σ ( a , b , k ) L ◮ A 2-gon begins c a ◮ σ ( b , a , 2) = 1 ◮ Some j -gons grow into j + 1-gons p i b d

  42. Updates at intersection ( a , b ) ◮ Some k -gons complete ◮ count += σ ( a , b , k ) L ◮ A 2-gon begins c a ◮ σ ( b , a , 2) = 1 ◮ Some j -gons grow into j + 1-gons p i ◮ For all segments c above a b d

  43. Updates at intersection ( a , b ) ◮ Some k -gons complete ◮ count += σ ( a , b , k ) L ◮ A 2-gon begins c a ◮ σ ( b , a , 2) = 1 ◮ Some j -gons grow into j + 1-gons p i ◮ For all segments c above a b d

  44. Updates at intersection ( a , b ) ◮ Some k -gons complete ◮ count += σ ( a , b , k ) L ◮ A 2-gon begins c a ◮ σ ( b , a , 2) = 1 ◮ Some j -gons grow into j + 1-gons p i ◮ For all segments c above a b σ ( c , b , j + 1) += σ ( c , a , j ) d

  45. Updates at intersection ( a , b ) ◮ Some k -gons complete ◮ count += σ ( a , b , k ) L ◮ A 2-gon begins c a ◮ σ ( b , a , 2) = 1 ◮ Some j -gons grow into j + 1-gons p i ◮ For all segments c above a b σ ( c , b , j + 1) += σ ( c , a , j ) d ◮ For all segments d below b

  46. Updates at intersection ( a , b ) ◮ Some k -gons complete ◮ count += σ ( a , b , k ) L ◮ A 2-gon begins c a ◮ σ ( b , a , 2) = 1 ◮ Some j -gons grow into j + 1-gons p i ◮ For all segments c above a b σ ( c , b , j + 1) += σ ( c , a , j ) d ◮ For all segments d below b

  47. Updates at intersection ( a , b ) ◮ Some k -gons complete ◮ count += σ ( a , b , k ) L ◮ A 2-gon begins c a ◮ σ ( b , a , 2) = 1 ◮ Some j -gons grow into j + 1-gons p i ◮ For all segments c above a b σ ( c , b , j + 1) += σ ( c , a , j ) d ◮ For all segments d below b σ ( a , d , j + 1) += σ ( b , d , j )

Recommend


More recommend