Mercurial > hg > nsaunier > traffic-intelligence
comparison python/tests/moving.txt @ 576:0eff0471f9cb
added functions to use trajectories as alignments
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Thu, 28 Aug 2014 16:42:13 -0400 |
| parents | cae4e5f3fe9f |
| children | d0abd2ee17b9 |
comparison
equal
deleted
inserted
replaced
| 575:13df64a9ff9d | 576:0eff0471f9cb |
|---|---|
| 94 (1.000000,3.000000) (1.000000,3.000000) (1.000000,3.000000) | 94 (1.000000,3.000000) (1.000000,3.000000) (1.000000,3.000000) |
| 95 >>> t1 = Trajectory([[0.5,1.5,3.5],[0.5,2.5,7.5]]) | 95 >>> t1 = Trajectory([[0.5,1.5,3.5],[0.5,2.5,7.5]]) |
| 96 >>> t1.differentiate() | 96 >>> t1.differentiate() |
| 97 (1.000000,2.000000) (2.000000,5.000000) | 97 (1.000000,2.000000) (2.000000,5.000000) |
| 98 | 98 |
| 99 >>> t1.computeCumulativeDistances() | |
| 100 >>> t1.getDistance(0) | |
| 101 2.23606797749979 | |
| 102 >>> t1.getDistance(1) | |
| 103 5.385164807134504 | |
| 104 >>> t1.getCumulativeDistance(1) | |
| 105 7.6212327846342935 | |
| 106 >>> t1.getCumulativeDistance(2) | |
| 107 Index 2 beyond trajectory length 3-1 | |
| 108 | |
| 109 | |
| 99 >>> from utils import LCSS | 110 >>> from utils import LCSS |
| 100 >>> lcss = LCSS(lambda x,y: Point.distanceNorm2(x,y) <= 0.1) | 111 >>> lcss = LCSS(lambda x,y: Point.distanceNorm2(x,y) <= 0.1) |
| 101 >>> Trajectory.lcss(t1, t1, lcss) | 112 >>> Trajectory.lcss(t1, t1, lcss) |
| 102 3 | 113 3 |
| 103 >>> lcss = LCSS(lambda p1, p2: (p1-p2).normMax() <= 0.1) | 114 >>> lcss = LCSS(lambda p1, p2: (p1-p2).normMax() <= 0.1) |
