Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computational Movement Analysis Lecture 3:

Similar presentations


Presentation on theme: "Computational Movement Analysis Lecture 3:"— Presentation transcript:

1 Computational Movement Analysis Lecture 3:
Curve simplification Joachim 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: units  278 points 10 units   174 points Time: ~15ms Car trajectory: Universe: ~20km  20km Number of points: 85K Error: meter  2601 points 10 meter   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 vf and 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 pj farthest from pipj. dist := the distance between vf and pipj. if dist >  then DP(P, vi , vf) DP(P, vf , vj) else Output(vivj) pj pi dist

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

17 Ramer-Douglas-Peucker
q p

18 Ramer-Douglas-Peucker
Time complexity? Testing a shortcut between pi and pj takes O(j-i) time. Worst-case recursion? Algorithm DP(P,i,j) Find the vertex vf farthest from pipj. dist := the distance between vf and pipj. if dist >  then DP(P, vi , vf) DP(P, vf , vj) else Output(vivj) 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 pi to 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 pi to 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 pi to 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 pi to 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 pi to 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 pi to 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 pi to 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 pi to 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 pi to 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 B(p,r) u

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 B(p,r) u 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 B(p,r) u v 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 B(p,r) u v 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| B(p,r+) lv rv Hu Hv Pu B(p,r) u v 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| B(p,r+) lv rv Hu Hv Pu B(p,r) u v 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| B(p,r+) lv rv Hu Hv Pu B(p,r) u v 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| B(p,r+) lv rv Hu Hv Pu B(p,r) u v 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 According to observation
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 According to observation
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 According to observation
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 According to observation
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

51 Imai-Iri Find all possible valid shortcuts

52 Imai-Iri Find all possible valid shortcuts > e

53 Imai-Iri Find all possible valid shortcuts <e <e

54 Imai-Iri Find all possible valid shortcuts >e

55 Imai-Iri Find all possible valid shortcuts >e

56 Imai-Iri Find all possible valid shortcuts >e

57 Imai-Iri Find all possible valid shortcuts >e

58 Imai-Iri Find all possible valid shortcuts >e

59 Imai-Iri Find all possible valid shortcuts >e

60 Imai-Iri Find all possible valid shortcuts

61 Imai-Iri Find all possible valid shortcuts

62 Imai-Iri Find all possible valid shortcuts

63 Imai-Iri Find all possible valid shortcuts

64 Imai-Iri Find all possible valid shortcuts

65 Imai-Iri Find all possible valid shortcuts

66 Imai-Iri All possible shortcuts!

67 Imai-Iri 1. Build a directed graph of valid shortcuts.
2. Compute a shortest path from p1 to pn using breadth-first search.

68 Imai-Iri 1. Build a directed graph of valid shortcuts.
2. Compute a shortest path from p1 to pn using breadth-first search.

69 Imai-Iri Brute force running time: ? #possible shortcuts ?

70 Summary: Imai-Iri Running time: O(n3) O(n2) possible shortcuts
O(n) per shortcut  O(n3) to build graph O(n2) BFS in the graph Output: A path with minimum number of edges Improvements: Chan and Chin’92: O(n2)

71 Results so far RDP: O(n2) time (simple and fast in practice)
Output: A path with no bound on the size of the path SS: O(n) time (simple and fast in practice) Imai-Iri: O(n2) time by Chan and Chin (complicated) Output: A path with minimum number of edges RDP and II use the Hausdorff error measure, SS use Fréchet Can we get something that is simple, fast and has a worst-case bound using the Fréchet error measure?

72 Agarwal et al. Agarwal, Har-Peled, Mustafa and Wang, 2002
Time: Running time O(n log n) Measure: Fréchet distance Output: Path has at most the same complexity as a minimum link (/2)-simplification

73 Analysis - Agarwal et al.
pi pm pj pl Let P = p1, p2, ... , pn be a polygonal curve Notation: Let (pipj) denote the Fréchet distance between (pi,pj) and the subpath (pi,pj) of P between pi and pj.

74 Algorithm - Agarwal et al.
Algorithm(P = p1,…,pn, ) i := 1 P’= p1 while i < n do find any j>i such that ((pi,pj)   and ((pi,pj+1) > ) or ((pi,pj)   and j=n) P’= concat(P,pj) i := j end return P’

75 Algorithm - Agarwal et al.
p1 Algorithm(P = p1,…,pn, ) i := 1 P’= p1 while i < n do find any j>i such that ((pi,pj)   and ((pi,pj+1) > ) or ((pi,pj)   and j=n) P’= concat(P,pj) i := j end return P’ pj Pj+1

76 Algorithm - Agarwal et al.
p1 Algorithm(P = p1,…,pn, ) i := 1 P’= p1 while i < n do find any j>i such that ((pi,pj)   and ((pi,pj+1) > ) or ((pi,pj)   and j=n) P’= concat(P,pj) i := j end return P’ pj Pj+1

77 Algorithm - Agarwal et al.
pi pj Pj+1 Efficient algorithm? Recall: Computing the Fréchet distance between (pi,pj) and (pi,pj) can be done in O(j-i) time (Lecture 1).

78 Algorithm - Agarwal et al.
pi pj Pj+1 Efficient algorithm? Recall: Computing the Fréchet distance between (pi,pj) and (pi,pj) can be done in O(j-i) time (Lecture 1). Finding the first j such that (pi,pj)   and (pi,pj+1) >  takes O(n2) time.

79 Algorithm - Agarwal et al.
How can we speed up the search for pj? Note that it is enough to find any vertex pj such that (pi,pj)   and (pi,pj+1) >  Idea: Search for pj using exponential search followed by binary search!

80 Algorithm - Agarwal et al.
Exponential search: Test pi+1, pi+2, pi+4, pi+8… until found pi+2k, such that (pi,pi+2k) > . Binary search: Search for pj between pi+2k-1 and pi+2k s.t. (pi,pj)   and (pi,pj+1) > .   >  i+2k-1 i+2k

81 Algorithm - Agarwal et al.
Exponential search: Test pi+1, pi+2, pi+4, pi+8… until found pi+2k, such that (pi,pi+2k) > . Binary search: Search for pj between pi+2k-1 and pi+2k s.t. (pi,pj)   and (pi,pj+1) > . if   then search right   >  i+2k-1 i+2k

82 Algorithm - Agarwal et al.
Exponential search: Test pi+1, pi+2, pi+4, pi+8… until found pi+2k, such that (pi,pi+2k) > . Binary search: Search for pj between pi+2k-1 and pi+2k s.t. (pi,pj)   and (pi,pj+1) > . if >  then search left   >  i+2k-1 i+2k

83 Algorithm - Agarwal et al.
Exponential search: Test pi+1, pi+2, pi+4, pi+8… until found pi+2k, such that (pi,pi+2k) > . Binary search: Search for pj between pi+2k-1 and pi+2k s.t. (pi,pj)   and (pi,pj+1) > .   >   > pj pj+1 i+2k-1 i+2k

84 Algorithm - Agarwal et al.
Exponential search: Test pi+1, pi+2, pi+4, pi+8… until found pi+2k, such that (pi,pi+2k) > . Iterations: O(log n) Binary search: Search for pj between pi+2k-1 and pi+2k s.t. (pi,pj)   and (pi,pj+1) > . Iterations: O(log n) Total time: O(n log n)

85 Analysis - Agarwal et al.
pi pm pj pl Lemma 1: Let P = p1, p2, ... , pn be a polygonal curve. For l ≤ i ≤ j ≤ m, (pipj) ≤ 2·(plpm).

86 Analysis - Agarwal et al.
pi pm pj pl Lemma 1: Let P = p1, p2, ... , pn be a polygonal curve. For l ≤ i ≤ j ≤ m, (pipj) ≤ 2·(plpm). Proof: Fix matching that realises (plpm). Set  = (plpm). qi qj

87 Analysis - Agarwal et al.
pi pm pj pl Lemma 1: Let P = p1, p2, ... , pn be a polygonal curve. For l ≤ i ≤ j ≤ m, (pipj) ≤ 2·(plpm). Proof: Fix matching that realises (plpm). Set  = (plpm). ((pipj),(qiqj)) ≤  qi qj

88 Analysis - Agarwal et al.
Lemma 1: Let P = p1, p2, ... , pn be a polygonal curve. For l ≤ i ≤ j ≤ m, (pipj) ≤ 2·(plpm). Proof: Fix matching that realises (plpm). Set  = (plpm). ((pipj),(qiqj)) ≤  qi pi pj (pipj) qj

89 Analysis - Agarwal et al.
pi pm pj pl Lemma 1: Let P = p1, p2, ... , pn be a polygonal curve. For l ≤ i ≤ j ≤ m, (pipj) ≤ 2·(plpm). Proof: Fix matching that realises (plpm). Set  = (plpm). ((pipj),(qiqj)) ≤  ((qiqj),(pipj)) ≤  qi qj

90 Analysis - Agarwal et al.
Lemma 1: Let P = p1, p2, ... , pn be a polygonal curve. For l ≤ i ≤ j ≤ m, (pipj) ≤ 2·(plpm). Proof: Fix matching that realises (plpm). Set  = (plpm). ((pipj),(qiqj)) ≤  ((qiqj),(pipj)) ≤  ≤  qi pi pj qj ≤ 

91 Analysis - Agarwal et al.
pi pm pj pl Lemma 1: Let P = p1, p2, ... , pn be a polygonal curve. For l ≤ i ≤ j ≤ m, (pipj) ≤ 2·(plpm). Proof: Fix matching that realises (plpm). Set  = (plpm). ((pipj),(qiqj)) ≤  ((qiqj),(pipj)) ≤  ((pipj),pipj) ≤ ≤ ((pipj),(qiqj)) + ((qiqj),(pipj)) ≤ 2 qi (pipj) qj

92 Analysis - Agarwal et al.
Theorem: (P,P’)   and |P’|  Popt(/2) Proof: (P,P’)   follows by construction.

93 Analysis - Agarwal et al.
pim-1 Theorem: |P’|  Popt(/2) Proof: Q = p1= pj1,…, pjl=pn - optimal (/2)-simplification P’ = p1= pi1,…, pik=pn Prove (by induction) that im  jm , m  1. pjm pim

94 Analysis - Agarwal et al.
pjm-1 pim-1 Theorem: |P’|  Popt(/2) Proof: Q = p1= pj1,…, pjl=pn - optimal (/2)-simplification P’ = p1= pi1,…, pik=pn Prove (by induction) that im  jm , m  1. Assume im-1  jm-1 and let i’ = im+1. pjm pim pi’

95 Analysis - Agarwal et al.
pjm-1 pim-1 Theorem: |P’|  Popt(/2) Proof: Q = p1= pj1,…, pjl=pn - optimal (/2)-simplification P’ = p1= pi1,…, pik=pn Prove (by induction) that im  jm , m  1. Assume im-1  jm-1 and let i’ = im+1. By construction we have: (pim-1pi’) >  and (pim-1pi’-1)    > pjm pim If i’ > jm then we are done! pi’

96 Analysis - Agarwal et al.
pjm-1 pim-1 Theorem: |P’|  Popt(/2) Proof: Q = p1= pj1,…, pjl=pn - optimal (/2)-simplification P’ = p1= pi1,…, pik=pn (pim-1pi’) >  and (pim-1pi’-1)   Assume the opposite i.e. i’  jm pim pi’ pjm

97 Analysis - Agarwal et al.
pjm-1 pim-1 Theorem: |P’|  Popt(/2) Proof: Q = p1= pj1,…, pjl=pn - optimal (/2)-simplification P’ = p1= pi1,…, pik=pn (pim-1pi’) >  and (pim-1pi’-1)   Assume the opposite i.e. i’  jm Q is an (/2)-simplification  (pjm-1pjm)  /2 pim pi’ pjm

98 Analysis - Agarwal et al.
pjm-1 pim-1 Theorem: |P’|  Popt(/2) Proof: Q = p1= pj1,…, pjl=pn - optimal (/2)-simplification P’ = p1= pi1,…, pik=pn (pim-1pi’) >  and (pim-1pi’-1)   Assume the opposite i.e. i’  jm Q is an (/2)-simplification  (pjm-1pjm)  /2 According to Lemma 1: (pim-1pi’)  2 (pjm-1pjm)   pim pi’ pjm

99 Analysis - Agarwal et al.
pjm-1 pim-1 Theorem: |P’|  Popt(/2) Proof: Q = p1= pj1,…, pjl=pn - optimal (/2)-simplification P’ = p1= pi1,…, pik=pn According to Lemma 1: (pim-1pi’)  2 (pjm-1pjm)   This is a contradiction since (pjm-1pjm) >  by construction.  i’ > jm and we are done! pjm pim pi’

100 Summary - Agarwal et al. Theorem:
Given a polygonal curve P in Rd and a parameter   0, an -simplification of P of size at most Popt(/2) can be constructed in O(n log n) time and O(n) space.

101 Summary Ramer–Douglas–Peucker 1973
Used very often in practice. Easy to implement and fast in practice. Hausdorff error Simple Simplification O(n) time - simple and fast Several nice properties. Fréchet error Imai-Iri 1988 Gives an optimal solution but slow. Hausdorff error Agarwal, Har-Peled, Mustafa and Wang 2005 Fast and easy to implement. Gives a worst-case performance guarantee. Fréchet error

102 Handle time? Compress trajectories s.t. standard database queries are “sound” after compression. The five standard database operations on a trajectory T are: where-at(T,t): location of e at time t. when-at(T,(x,y),L): time at which e is within distance L of (x,y) intersect: nearest-neighbour: spatial-join:

103 time at which e is within distance L of (x,y).
Handle time? where-at(T,t): location of e at time t. time t when-at(T,(x,y),L): time at which e is within distance L of (x,y). point (x,y)

104 Define distance between simplification and original trajectory.
Soundness  Define distance between simplification and original trajectory. Definition: A distance function is sound for a query q, if for each >0 there exists a >0, s.t. for every trajectory T and its -simplification T’ we have ||q(T)-q(T’)||< . [Cao, Wolfson & Trajcevski’06]

105 Path simplification Input path Traditional path simplification Aim 1 2
7 6 1 4 5 3 2 7 6 1 2 7 6? Input path Traditional path simplification Aim

106 Soundness Theorem: Trajectory = Polygonal path in 3D (x,y,time)
Transform time units into space units (x,y,z), where z = time   and  is the maximum speed along the trajectory. Use the Euclidean distance function. Theorem: Where-at, spatial-join, NN, intersect are sound When-at is NOT sound p q r t Where-at(T,t): Spatial error = |pq| = |pr|/sin(rqp)  2  

107 Soundness Theorem: Where-at, spatial-join, NN, intersect are sound
When-at is approximately sound Apx-When-at(T,(x,y),L): When within distance L from (x,y)? Set-Apx-when-at(T,(x,y),L) Set of time points when T is within distance L from (x, y) Given a query point q=(x, y), let t1 be the time reported by apx-when-at(T’,(x, y), L+). There exists a time point t2 in set-apx-when-at (T, (x, y), L+2) such that |t1 − t2| / and |T(t1) − T’(t2)|  .

108 Simplifying polygonal curves
Summary 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 Other interesting simplification algorithms Abam, de Berg, Hachenberger, Zarei 2007

109 Constraint FSD Recall the free space diagram (fsd)
Consider the fsd of two curves P and Q with respect to a distance r. (qQ,pP) in the fsd is in the free space iff dist(q,p)  r. Can we use it for other measures? (q1,p1) (qm,pn) P Q q p

110 Constraint FSD Example: (qQ,pP) in the fsd is in the free space iff p can “see” q. q p Can the owner and the dog walk along P and Q such that they always see each other?

111 Constraint FSD Example: (qQ,pP) in the fsd is in the free space iff p can “see” q. q p Can the owner and the dog walk along P and Q such that they always see each other? Yes!

112 Constraint FSD Example: The entities must walk with similar speed
(similar ~ within a factor of 2?). P Q Can the entities walk along P and Q with similar speed while keeping a distance of at most r?

113 Constraint FSD Example: The entities must walk with similar speed
(similar ~ within a factor of 2?). P Q Can the entities walk along P and Q with similar speed while keeping a distance of at most r?

114 Constraint FSD Example: The entities must walk with similar speed
(similar ~ within a factor of 2?). P Q Can the entities walk along P and Q with similar speed while keeping a distance of at most r?

115 Constraint FSD Example: The entities must walk with similar speed
(similar ~ within a factor of 2?). P Q Can the entities walk along P and Q with similar speed while keeping a distance of at most r?

116 Constraint FSD Example: The entities must walk with similar speed
(similar ~ within a factor of 2?). P Q Can the entities walk along P and Q with similar speed while keeping a distance of at most r? No!

117 Open Problem Can we find a subquadtratic algorithm that computed a simplification with a minimal number of edges, or within a constant factor?

118 References A. Driemel, S. Har-Peled and C. Wenk. Approximating the Fréchet Distance for Realistic Curves in Near Linear Time. Discrete & Computational Geometry , 2012. H. Cao, O. Wolfson, and G. Trajcevski. Spatio-temporal data reduction with deterministic error bounds. The VLDB Journal, 2006. W. S. Chan and F. Chin. Approximation of polygonal curves with minimum number of line segments. In Proceedings of the 3rd International Symposium on Algorithms and Computation, 1992. D. H. Douglas and T. K. Peucker. Algorithms for the reduction of the number of points required to represent a digitized line or its caricature. The Canadian Cartographer, 1973. J. Gudmundsson, J. Katajainen, D. Merrick, C. Ong and T. Wolle. Compressing spatio- temporal trajectories. Computational Geometry - Theory and Applications, 2009. P. K. Agarwal, S. Har-Peled, N. Mustafa, and Y. Wang. Near-linear time approximation algorithms for curve simplication in two and three dimensions. Algorithmica, 2005.


Download ppt "Computational Movement Analysis Lecture 3:"

Similar presentations


Ads by Google