1 / 118

Computational Movement Analysis Lecture 3: Curve simplification Joachim Gudmundsson

Computational Movement Analysis Lecture 3: Curve simplification Joachim Gudmundsson. Problem. Many algorithms handling movement data are slow, e.g. - similarity O(nm log nm) - approximate clustering O(n 2 +nml) - … Observation:

kailey
Télécharger la présentation

Computational Movement Analysis Lecture 3: Curve simplification Joachim Gudmundsson

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computational Movement AnalysisLecture 3: Curve simplificationJoachim Gudmundsson

  2. Problem Many algorithms handling movement data are slow, e.g. - similarity O(nm log nm) - approximate clustering O(n2+nml) - … Observation: Many trajectories can be simplified without losing much information.

  3. Problem Many algorithms handling movement data are slow, e.g. - - similarity O(nm log nm) - approximate clustering O(n2+nml) - … Observation: Many trajectories can be simplified without losing much information. Example:

  4. Problem Many algorithms handling movement data are slow, e.g. - similarity O(nm log nm) - approximate clustering O(n2+nml) - … Observation: Many trajectories can be simplified without losing much information. Example:

  5. Problem Many algorithms handling movement data are slow, e.g. - similarity O(nm log nm) - approximate clustering O(n2+nml) - … Observation: Many trajectories can be simplified without losing much information. Example:

  6. Problem Many algorithms handling movement data are slow, e.g. - similarity O(nm log nm) - approximate clustering O(n2+nml) - … Observation: Many trajectories can be simplified without losing much information. Example:

  7. Problem Many algorithms handling movement data are slow, e.g. - similarity O(nm log nm) - approximate clustering O(n2+nml) - … Observation: Many trajectories can be simplified without losing much information. Example:

  8. Problem Many algorithms handling movement data are slow, e.g. - similarity O(nm log nm) - approximate clustering O(n2+nml) - … Observation: Many trajectories can be simplified without losing much information. Example:

  9. Problem Many algorithms handling movement data are slow, e.g. - similarity O(nm log nm) - approximate clustering O(n2+nml) - … Observation: Many trajectories can be simplified without losing much information. Example:

  10. Problem Many algorithms handling movement data are slow, e.g. - similarity O(nm log nm) - approximate clustering O(n2+nml) - … Observation: Many trajectories can be simplified without losing much information. Example:

  11. Example Generated trajectory: Universe: 400x400 Number of points: 10K Error: 5 units  278 points 10 units   174 points Time: ~15ms Car trajectory: Universe: ~20km  20km Number of points: 85K Error: 5 meter  2601 points 10 meter   1728 points Time: ~200ms

  12. Outline • Simplifying polygonal curves • Ramer–Douglas–Peucker 1973 • Driemel, Har-Peled and Wenk, 2010 • Imai-Iri 1988 • Agarwal, Har-Peled, Mustafa and Wang, 2005 • Take time into consideration

  13. Ramer-Douglas-Peucker 1972 by Urs Ramer and 1973 by David Douglas and Thomas Peucker The most successful simplification algorithm. Used in GIS, geography, computer vision, pattern recognition… Very easy to implement and works well in practice. p

  14. Ramer-Douglas-Peucker Input polygonal path P = p1,…,pn and threshold  Initially i=1 and j=n Algorithm DP(P,i,j) • Find the vertex vf between pi and pj farthest from pipj. • dist := the distance between vfand pipj. • if dist >  then • DP(P,vi ,vf) • DP(P, vf, vj) • else • Output(vivj) pj pi

  15. Ramer-Douglas-Peucker Input polygonal path P = p1,…,pn and threshold  Initially i=1 and j=n Algorithm DP(P,i,j) • Find the vertex vf between pi and pjfarthest from pipj. • dist := the distance between vfand pipj. • if dist >  then • DP(P,vi ,vf) • DP(P, vf, vj) • else • Output(vivj) pj pi dist

  16. >e >e >e >e >e >e Ramer-Douglas-Peucker q p

  17. Ramer-Douglas-Peucker q p

  18. Ramer-Douglas-Peucker Time complexity? Testing a shortcut between pi and pj takes O(j-i) time. Algorithm DP(P,i,j) • Find the vertex vf farthest from pipj. • dist := the distance between vfand pipj. • if dist >  then • DP(P,vi ,vf) • DP(P, vf, vj) • else • Output(vivj) Worst-case recursion? DP(P, vi , vi+1) DP(P, vi+1, vj) Time complexity T(n) = O(n) + T(n-1) = O(n2)

  19. Summary: Ramer-Douglas-Peucker Worst-case time complexity: O(n2) In most realistic cases: T(n) = T(n1) + T(n2) + O(n) = O(n log n), where n1 and n2 are smaller than n/c for some constant c. If the curve is in 2D and it does not self-intersect then the algorithm can be implemented in O(n log* n) time. [Hershberger & Snoeiynk’98] Does not give any bound on the complexity of the simplification!

  20. Driemel et al. Simple simplification(P = p1,…,pn, ) P’:= p1 i:=1 while i<n do q := pi pi := first vertex pi in q,…,pns.t. |q-pi|>  if no such vertex then set i:=n add pito P’ end return P’ 

  21. Driemel et al. Simple simplification(P = p1,…,pn, ) P’:= p1 i:=1 while i<n do q := pi pi := first vertex pi in q,…,pns.t. |q-pi|>  if no such vertex then set i:=n add pito P’ end return P’ 

  22. Driemel et al. Simple simplification(P = p1,…,pn, ) P’:= p1 i:=1 while i<n do q := pi pi := first vertex pi in q,…,pns.t. |q-pi|>  if no such vertex then set i:=n add pito P’ end return P’ 

  23. Driemel et al. Simple simplification(P = p1,…,pn, ) P’:= p1 i:=1 while i<n do q := pi pi := first vertex pi in q,…,pns.t. |q-pi|>  if no such vertex then set i:=n add pito P’ end return P’ 

  24. Driemel et al. Simple simplification(P = p1,…,pn, ) P’:= p1 i:=1 while i<n do q := pi pi := first vertex pi in q,…,pns.t. |q-pi|>  if no such vertex then set i:=n add pito P’ end return P’ 

  25. Driemel et al. Simple simplification(P = p1,…,pn, ) P’:= p1 i:=1 while i<n do q := pi pi := first vertex pi in q,…,pns.t. |q-pi|>  if no such vertex then set i:=n add pito P’ end return P’ 

  26. Driemel et al. Simple simplification(P = p1,…,pn, ) P’:= p1 i:=1 while i<n do q := pi pi := first vertex pi in q,…,pns.t. |q-pi|>  if no such vertex then set i:=n add pito P’ end return P’ 

  27. Driemel et al. Simple simplification(P = p1,…,pn, ) P’:= p1 i:=1 while i<n do q := pi pi := first vertex pi in q,…,pns.t. |q-pi|>  if no such vertex then set i:=n add pito P’ end return P’ 

  28. Driemel et al. Simple simplification(P = p1,…,pn, ) P’:= p1 i:=1 while i<n do q := pi pi := first vertex pi in q,…,pns.t. |q-pi|>  if no such vertex then set i:=n add pito P’ end return P’

  29. Driemel et al. Simple simplification(P = p1,…,pn, ) Property 1: All edges (except the last one) have length at least . Property 2: F(P,P’)  

  30. Driemel et al. Simple simplification(P = p1,…,pn, ) Property 1: All edges (except the last one) have length at least . Property 2: F(P,P’)   Definition: A curve P is c-packed, if has finite length, and for any ball b(p,r) it holds |P b(p,r)| < cr. Property 3: If P is c-packed then P’ is 6c-packed.

  31. Driemel et al. Aim: Prove Property 3 If P is c-packed then P’ is 6c-packed. We need the following observation: Let P be a curve and let P’ be an -simplification of P |P  B(p,r+ )|  |P’  B(p,r)| for any ball B(p,r) Proof: B(p,r)

  32. Driemel et al. Observation: Let P be a curve and let P’ be an -simplification of P |P  B(p,r+)|  |P’  B(p,r)| for any ball B(p,r) Proof: Pu u B(p,r)

  33. Driemel et al. Observation: Let P be a curve and let P’ be an -simplification of P |P  B(p,r+)|  |P’  B(p,r)| for any ball B(p,r) Proof: Hu Pu u  B(p,r) Pu must lie inside Hu

  34. Driemel et al. Observation: Let P be a curve and let P’ be an -simplification of P |P  B(p,r+)|  |P’  B(p,r)| for any ball B(p,r) Proof: |B(p,r)  u| =|v| lv rv Hu Pu u v  B(p,r) Pu must intersect lv and rv  |PuHv|  |v|

  35. Driemel et al. Observation: Let P be a curve and let P’ be an -simplification of P |P  B(p,r+)| v |P’  B(p,r)| for any ball B(p,r) Proof: |B(p,r)  u| =|v| lv rv Hu Pu u v  B(p,r) v  B(p,r)

  36. Driemel et al. Observation: Let P be a curve and let P’ be an -simplification of P |P  B(p,r+)|  |P’  B(p,r)| for any ball B(p,r) Proof: |B(p,r)  u| =|v| lv rv Hu Hv Pu u v  B(p,r+) B(p,r) v  B(p,r)

  37. Driemel et al. Observation: Let P be a curve and let P’ be an -simplification of P |P  B(p,r+)|  |P’  B(p,r)| for any ball B(p,r) Proof: |B(p,r)  u| =|v| lv rv Hu Hv Pu u v  B(p,r+) B(p,r) v  B(p,r)  Hv B(p,r+)

  38. Driemel et al. Observation: Let P be a curve and let P’ be an -simplification of P |P  B(p,r+)|  |P’  B(p,r)| for any ball B(p,r) Proof: |B(p,r)  u| =|v| lv rv Hu Hv Pu u v  B(p,r+) B(p,r) v  B(p,r)  Hv B(p,r+)  Pu Hv B(p,r+)

  39. Driemel et al. Observation: Let P be a curve and let P’ be an -simplification of P |P  B(p,r+)|  |P’  B(p,r)| for any ball B(p,r) Proof: |B(p,r)  u| =|v| lv rv Hu Hv Pu u v  B(p,r+) B(p,r) v  B(p,r)  Hv B(p,r+)  Pu Hv B(p,r+)  |Pu  B(p,r+)|  |v|

  40. Driemel et al. Theorem:If P is c-packed then P’ is 6c-packed. Observation: Let P be a curve and let P’ be an -simplification of P |P  B(p,r+ )|  |P’  B(p,r)| for any ball B(p,r)

  41. Driemel et al. Theorem:If P is c-packed then P’ is 6c-packed. Proof: Proof by contradiction. Assume |P’B(p,r)|>6cr for some B(p,r) Two cases: r   or r< Case r  : |P  B(p,2r)|

  42. Driemel et al. Theorem:If P is c-packed then P’ is 6c-packed. Proof: Proof by contradiction. Assume |P’B(p,r)|>6cr for some B(p,r) Two cases: r   or r< Case r  : |P  B(p,2r)|  |P B(p,r+)|

  43. Driemel et al. Theorem:If P is c-packed then P’ is 6c-packed. Proof: Proof by contradiction. Assume |P’B(p,r)|>6cr for some B(p,r) Two cases: r   or r< Case r  : |P  B(p,2r)|  |P B(p,r+)|  |P’ B(p,r)| According to observation

  44. Driemel et al. Theorem:If P is c-packed then P’ is 6c-packed. Proof: Proof by contradiction. Assume |P’B(p,r)|>6cr for some B(p,r) Two cases: r   or r< Case r  : |P  B(p,2r)|  |P B(p,r+)|  |P’ B(p,r)| > 6cr According to observation

  45. Driemel et al. Theorem:If P is c-packed then P’ is 6c-packed. Proof: Proof by contradiction. Assume |P’B(p,r)|>6cr for some B(p,r) Two cases: r   or r< Case r  : |P  B(p,2r)|  |P B(p,r+)|  |P’ B(p,r)| > 6cr |P  B(p,2r)| > 6cr  |P  B(p,r’)| > 3cr’ which contradicts that P is c-packed According to observation

  46. Driemel et al. Theorem:If P is c-packed then P’ is 6c-packed. Proof: Proof by contradiction. Assume |P’B(p,r)|>6cr for some B(p,r) Two cases: r   or r< Case r  : |P  B(p,2r)|  |P B(p,r+)|  |P’ B(p,r)| > 6cr |P  B(p,2r)| > 6cr  |P  B(p,r’)| > 3cr’ which contradicts that P is c-packed Case r < : Proof is similar. According to observation

  47. Summary: Driemel et al. Simple simplification: can be computed in O(n) time Property 1: All edges (except the last one) have length at least . Property 2: F(P,P’)   Definition: A curve P is c-packed, if has finite length, and for any ball b(p,r) it holds |P b(p,r)| < cr. Property 3: If P is c-packed then P’ is 6c-packed.

  48. Imai-Iri Both previous algorithms are simple and fast but do not give a bound on the complexity of the simplification! Imai-Iri 1988 gave an algorithm that produces a -simplification with the minimum number of links.

  49. Imai-Iri Input polygonal path P = p1,…,pn and threshold  Build a graph G containing all valid shortcuts. Find a minimum link path from p1 to pn in G

  50. Imai-Iri Input polygonal path P = p1,…,pn and threshold  Build a graph G containing all valid shortcuts. Find a minimum link path from p1 to pn in G

More Related