computational movement analysis lecture 3: curve simplification joachim gudmundsson
Post on 22-Feb-2016
32 Views
Preview:
DESCRIPTION
TRANSCRIPT
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(n2+nml)- …
Observation:Many trajectories can be simplified without losing much information.
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:
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:
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:
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:
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:
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:
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:
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:
Example
Generated trajectory:
Universe: 400x400Number of points: 10KError: 5 units 278 points
10 units 174 points Time: ~15ms
Car trajectory:
Universe: ~20km 20kmNumber of points: 85KError: 5 meter 2601 points
10 meter 1728 points Time: ~200ms
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
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
pjpi
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 > thenDP(P, vi , vf)DP(P, vf , vj)
elseOutput(vivj)
pjpi
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 > thenDP(P, vi , vf)DP(P, vf , vj)
elseOutput(vivj)
dist
>
>
Ramer-Douglas-Peucker
>
>
>
>
p
q
Ramer-Douglas-Peucker
p
q
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 > thenDP(P, vi , vf)DP(P, vf , vj)
elseOutput(vivj)
DP(P, vi , vi+1)DP(P, vi+1 , vj)
Time complexity T(n) = O(n) + T(n-1) = O(n2)
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!
Driemel et al.
Simple simplification(P = p1,…,pn, ) P’:= p1i:=1while i<n do q := pi
pi := first vertex pi in q,…,pn s.t. |q-pi|> if no such vertex then set i:=nadd pi to P’
endreturn P’
Driemel et al.
Simple simplification(P = p1,…,pn, ) P’:= p1i:=1while i<n do q := pi
pi := first vertex pi in q,…,pn s.t. |q-pi|> if no such vertex then set i:=nadd pi to P’
endreturn P’
Driemel et al.
Simple simplification(P = p1,…,pn, ) P’:= p1i:=1while i<n do q := pi
pi := first vertex pi in q,…,pn s.t. |q-pi|> if no such vertex then set i:=nadd pi to P’
endreturn P’
Driemel et al.
Simple simplification(P = p1,…,pn, ) P’:= p1i:=1while i<n do q := pi
pi := first vertex pi in q,…,pn s.t. |q-pi|> if no such vertex then set i:=nadd pi to P’
endreturn P’
Driemel et al.
Simple simplification(P = p1,…,pn, ) P’:= p1i:=1while i<n do q := pi
pi := first vertex pi in q,…,pn s.t. |q-pi|> if no such vertex then set i:=nadd pi to P’
endreturn P’
Driemel et al.
Simple simplification(P = p1,…,pn, ) P’:= p1i:=1while i<n do q := pi
pi := first vertex pi in q,…,pn s.t. |q-pi|> if no such vertex then set i:=nadd pi to P’
endreturn P’
Driemel et al.
Simple simplification(P = p1,…,pn, ) P’:= p1i:=1while i<n do q := pi
pi := first vertex pi in q,…,pn s.t. |q-pi|> if no such vertex then set i:=nadd pi to P’
endreturn P’
Driemel et al.
Simple simplification(P = p1,…,pn, ) P’:= p1i:=1while i<n do q := pi
pi := first vertex pi in q,…,pn s.t. |q-pi|> if no such vertex then set i:=nadd pi to P’
endreturn P’
Driemel et al.
Simple simplification(P = p1,…,pn, ) P’:= p1i:=1while i<n do q := pi
pi := first vertex pi in q,…,pn s.t. |q-pi|> if no such vertex then set i:=nadd pi to P’
endreturn P’
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’)
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.
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)
Pu
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
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)
uPu
Hu
Pu must lie inside Hu
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)
uPu
Hu
v
lv rv
Pu must intersect lv and rv |PuHv| |v|
|B(p,r) u| = |v|
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)
uPu
Hu
v
lv rv
v B(p,r)
|B(p,r) u| = |v|
Hv
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)
uPu
Hu
v
lv rv
v B(p,r)
B(p,r+)
|B(p,r) u| = |v|
Hv
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)
uPu
Hu
v
lv rv
B(p,r+)
v B(p,r) Hv B(p,r+)
|B(p,r) u| = |v|
Hv
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)
uPu
Hu
v
lv rv
B(p,r+)
v B(p,r) Hv B(p,r+) Pu Hv B(p,r+)
|B(p,r) u| = |v|
Hv
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)
uPu
Hu
v
lv rv
B(p,r+)
v B(p,r) Hv B(p,r+) Pu Hv B(p,r+) |Pu B(p,r+)| |v|
|B(p,r) u| = |v|
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)
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)|
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+)|
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
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
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
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
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.
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.
Imai-Iri
Input polygonal path P = p1,…,pn and threshold
1. Build a graph G containing all valid shortcuts.2. Find a minimum link path from p1 to pn in G
Imai-Iri
Input polygonal path P = p1,…,pn and threshold
1. Build a graph G containing all valid shortcuts.2. Find a minimum link path from p1 to pn in G
Imai-Iri
Find all possible valid shortcuts
Imai-Iri
Find all possible valid shortcuts
>
Imai-Iri
Find all possible valid shortcuts
<<
Imai-Iri
Find all possible valid shortcuts
>
Imai-Iri
Find all possible valid shortcuts
>
Imai-Iri
Find all possible valid shortcuts
>
Imai-Iri
Find all possible valid shortcuts
>
Imai-Iri
Find all possible valid shortcuts
>
Imai-Iri
Find all possible valid shortcuts
>
Imai-Iri
Find all possible valid shortcuts
Imai-Iri
Find all possible valid shortcuts
Imai-Iri
Find all possible valid shortcuts
Imai-Iri
Find all possible valid shortcuts
Imai-Iri
Find all possible valid shortcuts
Imai-Iri
Find all possible valid shortcuts
Imai-Iri
All possible shortcuts!
Imai-Iri
1. Build a directed graph of valid shortcuts.2. Compute a shortest path from p1 to pn using breadth-first search.
Imai-Iri
1. Build a directed graph of valid shortcuts.2. Compute a shortest path from p1 to pn using breadth-first search.
Imai-Iri
Brute force running time: ? #possible shortcuts ?
Summary: Imai-Iri
Running time: O(n3) O(n2) possible shortcuts
O(n) per shortcut O(n3) to build graphO(n2) BFS in the graph
Output: A path with minimum number of edges
Improvements: Chan and Chin’92: O(n2)
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)Output: A path with no bound on the size of the path
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?
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
Analysis - Agarwal et al.
Notation: Let (pipj) denote the Fréchet distance between (pi,pj) and the subpath (pi,pj) of P between pi and pj.
Let P = p1, p2, ... , pn be a polygonal curve pi
pm
pj
pl
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’
Algorithm - Agarwal et al.
p1
pj
Pj+
1
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’
Algorithm - Agarwal et al.
p1
pj
Pj+
1
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’
Algorithm - Agarwal et al.
Efficient algorithm?
Recall: Computing the Fréchet distance between (pi,pj) and (pi,pj) can be done in O(j-i) time (Lecture 1).
pi
pj
Pj+1
Algorithm - Agarwal et al.
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.
pi
pj
Pj+1
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!
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
>
Algorithm - Agarwal et al.
> if then
search right
Binary search:Search for pj between pi+2k-1 and pi+2k s.t.
(pi,pj) and (pi,pj+1) > .
Exponential search:Test pi+1, pi+2, pi+4, pi+8… until found pi+2k, such that (pi,pi+2k) > .
i+2k-1 i+2k
Algorithm - Agarwal et al.
>
Binary search:Search for pj between pi+2k-1 and pi+2k s.t.
(pi,pj) and (pi,pj+1) > .
Exponential search:Test pi+1, pi+2, pi+4, pi+8… until found pi+2k, such that (pi,pi+2k) > .
i+2k-1 i+2k
if > thensearch left
Algorithm - Agarwal et al.
>
Binary search:Search for pj between pi+2k-1 and pi+2k s.t.
(pi,pj) and (pi,pj+1) > .
Exponential search:Test pi+1, pi+2, pi+4, pi+8… until found pi+2k, such that (pi,pi+2k) > .
i+2k-1 i+2kpj pj+1
>
Algorithm - Agarwal et al.
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)
Exponential search:Test pi+1, pi+2, pi+4, pi+8… until found pi+2k, such that (pi,pi+2k) > . Iterations: O(log n)
Analysis - Agarwal et al.
Lemma 1: Let P = p1, p2, ... , pn be a polygonal curve. For l ≤ i ≤ j ≤ m, (pipj) ≤ 2·(plpm).
pi
pm
pj
pl
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).
pi
pm
pj
pl
qj
qi
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).
1. ((pipj),(qiqj)) ≤
pi
pm
pj
pl
qj
qi
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).
1. ((pipj),(qiqj)) ≤
pi
pj
qj
qi
(pipj)
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).
1. ((pipj),(qiqj)) ≤
2. ((qiqj),(pipj)) ≤
pi
pm
pj
pl
qj
qi
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).
1. ((pipj),(qiqj)) ≤
2. ((qiqj),(pipj)) ≤
pi
pj
qj
qi
≤
≤
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).
1. ((pipj),(qiqj)) ≤
2. ((qiqj),(pipj)) ≤
((pipj),pipj) ≤ ≤ ((pipj),(qiqj)) + ((qiqj),(pipj)) ≤ 2
pi
pm
pj
pl
qj
qi
□
(pipj)
Analysis - Agarwal et al.
Theorem: (P,P’) and |P’| Popt(/2)
Proof: (P,P’) follows by construction.
Analysis - Agarwal et al.
Theorem: |P’| Popt(/2)
Proof: Q = p1= pj1
,…, pjl=pn - optimal (/2)-
simplificationP’ = p1= pi1
,…, pik=pn
Prove (by induction) that im jm , m 1.
pim-1
pjm
pim
Analysis - Agarwal et al.
Theorem: |P’| Popt(/2)
Proof: Q = p1= pj1
,…, pjl=pn - optimal (/2)-
simplificationP’ = p1= pi1
,…, pik=pn
Prove (by induction) that im jm , m 1.
Assume im-1 jm-1 and let i’ = im+1.
pim-1
pjm
pimpi’
pjm-1
Analysis - Agarwal et al.
Theorem: |P’| Popt(/2)
Proof: Q = p1= pj1
,…, pjl=pn - optimal (/2)-
simplificationP’ = 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-1
pi’) > and (pim-1pi’-1)
pim-1
pjm
pimpi’
pjm-1
If i’ > jm then we are done!
>
Analysis - Agarwal et al.
Theorem: |P’| Popt(/2)
Proof: Q = p1= pj1
,…, pjl=pn - optimal (/2)-
simplificationP’ = p1= pi1
,…, pik=pn
(pim-1pi’) > and (pim-1
pi’-1)
Assume the opposite i.e. i’ jm
pim-1
pjm
pim
pi’
pjm-1
Analysis - Agarwal et al.
Theorem: |P’| Popt(/2)
Proof: Q = p1= pj1
,…, pjl=pn - optimal (/2)-
simplificationP’ = p1= pi1
,…, pik=pn
(pim-1pi’) > and (pim-1
pi’-1)
Assume the opposite i.e. i’ jm
Q is an (/2)-simplification (pjm-1pjm
) /2
pim-1
pjm
pim
pi’
pjm-1
Analysis - Agarwal et al.
Theorem: |P’| Popt(/2)
Proof: Q = p1= pj1
,…, pjl=pn - optimal (/2)-
simplificationP’ = p1= pi1
,…, pik=pn
(pim-1pi’) > and (pim-1
pi’-1)
Assume the opposite i.e. i’ jm
Q is an (/2)-simplification (pjm-1pjm
) /2
According to Lemma 1: (pim-1
pi’) 2 (pjm-1pjm
)
pim-1
pjm
pim
pi’
pjm-1
Analysis - Agarwal et al.
Theorem: |P’| Popt(/2)
Proof: Q = p1= pj1
,…, pjl=pn - optimal (/2)-
simplificationP’ = p1= pi1
,…, pik=pn
According to Lemma 1: (pim-1
pi’) 2 (pjm-1pjm
)
This is a contradiction since (pjm-1pjm
) > by construction.
i’ > jm and we are done!
pim-1
pjm
pimpi’
pjm-1
□
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.
Summary
• Ramer–Douglas–Peucker 1973Used very often in practice. Easy to implement and
fast in practice. Hausdorff error
• Simple Simplification O(n) time - simple and fastSeveral nice properties. Fréchet error
• Imai-Iri 1988Gives an optimal solution but slow. Hausdorff error
• Agarwal, Har-Peled, Mustafa and Wang 2005Fast and easy to implement. Gives a worst-case
performance guarantee. Fréchet error
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:
• where-at(T,t): location of e at time t.
time t
point (x,y)
• when-at(T,(x,y),L): time at which e is within distance L of (x,y).
Handle time?
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]
Path simplification
1
45
32
7
6
1
2
7
1
2
7
6
6?
Input path Traditional path simplification
Aim
Soundness
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
Where-at(T,t): Spatial error = |pq|
= |pr|/sin(rqp) 2
pq
rt
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)| .
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
Constraint FSD
Recall the free space diagram (fsd)Consider the fsd of two curves P and Q with respect to a distance r. (qQ,pP) in the fsd is in the free space iff dist(q,p) r.
(q1,p1)
(qm,pn)
P
Q
Can we use it for other measures?
qp
Constraint FSD
Example: (qQ,pP) 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?
Constraint FSD
Example: (qQ,pP) 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!
Constraint FSD
Example: The entities must walk with similar speed (similar ~ within a factor of 2?).
Can the entities walk along P and Q with similar speed while keeping a distance of at most r?
P
Q
Constraint FSD
Example: The entities must walk with similar speed (similar ~ within a factor of 2?).
Can the entities walk along P and Q with similar speed while keeping a distance of at most r?
P
Q
Constraint FSD
Example: The entities must walk with similar speed (similar ~ within a factor of 2?).
Can the entities walk along P and Q with similar speed while keeping a distance of at most r?
P
Q
Constraint FSD
Example: The entities must walk with similar speed (similar ~ within a factor of 2?).
Can the entities walk along P and Q with similar speed while keeping a distance of at most r?
P
Q
Constraint FSD
Example: The entities must walk with similar speed (similar ~ within a factor of 2?).
Can the entities walk along P and Q with similar speed while keeping a distance of at most r? No!
P
Q
Open Problem
1. Can we find a subquadtratic algorithm that computed a simplification with a minimal number of edges, or within a constant factor?
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.
top related