|
Algorithm 1: Spot extraction |
|
Input: A trajectory T, δG, δD
|
Output: A spot sequence S
|
|
1: |
i = 0, S = <>; |
2: |
while
i < length (T) do
|
3: |
j = i + 1, skipped = 0; lastIndex = i; |
4: |
sp = 〈pi〉; // start a new spot |
5: |
while
j < length (T) do
|
6: |
if
skipped ≥ δG
then // end of the current spot |
7: |
setStartEndTime(sp); |
8: |
S.Append(sp); |
9: |
break; |
10: |
else if
dist(p; sp.c) ≤ δD
then
|
11: |
sp.Append(pj); |
12: |
lastIndex = lastIndex + 1; // reset the number of point skipped continuously |
13: |
else // the current point is consider as the noise |
14: |
skipped = skipped + 1; |
15: |
end if
|
16: |
j = j + 1; |
17: |
end while
|
18: |
i = lastIndex + 1; |
19: |
end while
|
20: |
return
S
|
|