Mercurial > hg > nsaunier > traffic-intelligence
comparison python/tests/moving.txt @ 795:a34ec862371f
merged with dev branch
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Mon, 09 May 2016 15:33:11 -0400 |
| parents | 84420159c5f4 |
| children | e2452abba0e7 |
comparison
equal
deleted
inserted
replaced
| 758:0a05883216cf | 795:a34ec862371f |
|---|---|
| 17 | 17 |
| 18 >>> TimeInterval(0,1).length() | 18 >>> TimeInterval(0,1).length() |
| 19 2.0 | 19 2.0 |
| 20 >>> TimeInterval(10,8).length() | 20 >>> TimeInterval(10,8).length() |
| 21 0.0 | 21 0.0 |
| 22 >>> TimeInterval(10,8) == TimeInterval(10,8) | |
| 23 True | |
| 24 >>> TimeInterval(10,8) == TimeInterval(8,10) | |
| 25 True | |
| 26 >>> TimeInterval(11,8) == TimeInterval(10,8) | |
| 27 False | |
| 22 | 28 |
| 23 >>> [i for i in TimeInterval(9,13)] | 29 >>> [i for i in TimeInterval(9,13)] |
| 24 [9, 10, 11, 12, 13] | 30 [9, 10, 11, 12, 13] |
| 25 | 31 |
| 26 >>> TimeInterval(2,5).equal(TimeInterval(2,5)) | 32 >>> TimeInterval(2,5).equal(TimeInterval(2,5)) |
| 39 >>> TimeInterval(20,30).distance(TimeInterval(3,15)) | 45 >>> TimeInterval(20,30).distance(TimeInterval(3,15)) |
| 40 5 | 46 5 |
| 41 >>> TimeInterval.unionIntervals([TimeInterval(3,6), TimeInterval(8,10),TimeInterval(11,15)]) | 47 >>> TimeInterval.unionIntervals([TimeInterval(3,6), TimeInterval(8,10),TimeInterval(11,15)]) |
| 42 [3, 15] | 48 [3, 15] |
| 43 | 49 |
| 50 >>> Point(0,3) == Point(0,3) | |
| 51 True | |
| 52 >>> Point(0,3) == Point(0,3.2) | |
| 53 False | |
| 44 >>> Point(3,4)-Point(1,7) | 54 >>> Point(3,4)-Point(1,7) |
| 45 (2.000000,-3.000000) | 55 (2.000000,-3.000000) |
| 46 >>> -Point(1,2) | 56 >>> -Point(1,2) |
| 47 (-1.000000,-2.000000) | 57 (-1.000000,-2.000000) |
| 48 >>> Point(1,2).multiply(0.5) | 58 >>> Point(1,2).multiply(0.5) |
| 67 >>> segmentIntersection(Point(0.,0.), Point(2.,2.), Point(0.,2.), Point(2.,0.)) | 77 >>> segmentIntersection(Point(0.,0.), Point(2.,2.), Point(0.,2.), Point(2.,0.)) |
| 68 (1.000000,1.000000) | 78 (1.000000,1.000000) |
| 69 >>> segmentIntersection(Point(0,0), Point(4,4), Point(0,4), Point(4,0)) | 79 >>> segmentIntersection(Point(0,0), Point(4,4), Point(0,4), Point(4,0)) |
| 70 (2.000000,2.000000) | 80 (2.000000,2.000000) |
| 71 >>> segmentIntersection(Point(0,1), Point(1,2), Point(2,0), Point(3,2)) | 81 >>> segmentIntersection(Point(0,1), Point(1,2), Point(2,0), Point(3,2)) |
| 82 | |
| 83 >>> t1 = Trajectory.fromPointList([(92.2, 102.9), (56.7, 69.6)]) | |
| 84 >>> t2 = Trajectory.fromPointList([(92.2, 102.9), (56.7, 69.6)]) | |
| 85 >>> t1 == t2 | |
| 86 True | |
| 87 >>> t3 = Trajectory.fromPointList([(92.24, 102.9), (56.7, 69.6)]) | |
| 88 >>> t1 == t3 | |
| 89 False | |
| 90 >>> t3 = Trajectory.fromPointList([(92.2, 102.9), (56.7, 69.6), (56.7, 69.6)]) | |
| 91 >>> t1 == t3 | |
| 92 False | |
| 72 | 93 |
| 73 >>> left = Trajectory.fromPointList([(92.291666666666686, 102.99239033124439), (56.774193548387103, 69.688898836168306)]) | 94 >>> left = Trajectory.fromPointList([(92.291666666666686, 102.99239033124439), (56.774193548387103, 69.688898836168306)]) |
| 74 >>> middle = Trajectory.fromPointList([(87.211021505376351, 93.390778871978512), (59.032258064516128, 67.540286481647257)]) | 95 >>> middle = Trajectory.fromPointList([(87.211021505376351, 93.390778871978512), (59.032258064516128, 67.540286481647257)]) |
| 75 >>> right = Trajectory.fromPointList([(118.82392473118281, 115.68263205013426), (63.172043010752688, 66.600268576544309)]) | 96 >>> right = Trajectory.fromPointList([(118.82392473118281, 115.68263205013426), (63.172043010752688, 66.600268576544309)]) |
| 76 >>> alignments = [left, middle, right] | 97 >>> alignments = [left, middle, right] |
| 174 >>> o1.classifyUserTypeSpeedMotorized(1.5, np.median) | 195 >>> o1.classifyUserTypeSpeedMotorized(1.5, np.median) |
| 175 >>> userTypeNames[o1.getUserType()] | 196 >>> userTypeNames[o1.getUserType()] |
| 176 'pedestrian' | 197 'pedestrian' |
| 177 | 198 |
| 178 >>> o1 = MovingObject.generate(Point(0.,0.), Point(1.,0.), TimeInterval(0,10)) | 199 >>> o1 = MovingObject.generate(Point(0.,0.), Point(1.,0.), TimeInterval(0,10)) |
| 179 >>> gt1 = BBAnnotation(1, TimeInterval(0,10), MovingObject.generate(Point(0.2,0.6), Point(1.,0.), TimeInterval(0,10)), MovingObject.generate(Point(-0.2,-0.4), Point(1.,0.), TimeInterval(0,10))) | 200 >>> gt1 = BBMovingObject(1, TimeInterval(0,10), MovingObject.generate(Point(0.2,0.6), Point(1.,0.), TimeInterval(0,10)), MovingObject.generate(Point(-0.2,-0.4), Point(1.,0.), TimeInterval(0,10))) |
| 180 >>> gt1.computeCentroidTrajectory() | 201 >>> gt1.computeCentroidTrajectory() |
| 181 >>> computeClearMOT([gt1], [], 0.2, 0, 10) | 202 >>> computeClearMOT([gt1], [], 0.2, 0, 10) |
| 182 (None, 0.0, 11, 0, 0, 11) | 203 (None, 0.0, 11, 0, 0, 11) |
| 183 >>> computeClearMOT([], [o1], 0.2, 0, 10) | 204 >>> computeClearMOT([], [o1], 0.2, 0, 10) |
| 184 (None, None, 0, 0, 11, 0) | 205 (None, None, 0, 0, 11, 0) |
| 187 >>> computeClearMOT([gt1], [o1], 0.05, 0, 10) | 208 >>> computeClearMOT([gt1], [o1], 0.05, 0, 10) |
| 188 (None, -1.0, 11, 0, 11, 11) | 209 (None, -1.0, 11, 0, 11, 11) |
| 189 | 210 |
| 190 >>> o1 = MovingObject(1, TimeInterval(0,3), positions = Trajectory([range(4), [0.1, 0.1, 1.1, 1.1]])) | 211 >>> o1 = MovingObject(1, TimeInterval(0,3), positions = Trajectory([range(4), [0.1, 0.1, 1.1, 1.1]])) |
| 191 >>> o2 = MovingObject(2, TimeInterval(0,3), positions = Trajectory([range(4), [0.9, 0.9, -0.1, -0.1]])) | 212 >>> o2 = MovingObject(2, TimeInterval(0,3), positions = Trajectory([range(4), [0.9, 0.9, -0.1, -0.1]])) |
| 192 >>> gt1 = BBAnnotation(1, TimeInterval(0,3), MovingObject(positions = Trajectory([range(4), [0.]*4])), MovingObject(positions = Trajectory([range(4), [0.]*4]))) | 213 >>> gt1 = BBMovingObject(1, TimeInterval(0,3), MovingObject(positions = Trajectory([range(4), [0.]*4])), MovingObject(positions = Trajectory([range(4), [0.]*4]))) |
| 193 >>> gt1.computeCentroidTrajectory() | 214 >>> gt1.computeCentroidTrajectory() |
| 194 >>> gt2 = BBAnnotation(2, TimeInterval(0,3), MovingObject(positions = Trajectory([range(4), [1.]*4])), MovingObject(positions = Trajectory([range(4), [1.]*4]))) | 215 >>> gt2 = BBMovingObject(2, TimeInterval(0,3), MovingObject(positions = Trajectory([range(4), [1.]*4])), MovingObject(positions = Trajectory([range(4), [1.]*4]))) |
| 195 >>> gt2.computeCentroidTrajectory() | 216 >>> gt2.computeCentroidTrajectory() |
| 196 >>> computeClearMOT([gt1, gt2], [o1, o2], 0.2, 0, 3) # doctest:+ELLIPSIS | 217 >>> computeClearMOT([gt1, gt2], [o1, o2], 0.2, 0, 3) # doctest:+ELLIPSIS |
| 197 (0.1..., 0.75, 0, 2, 0, 8) | 218 (0.1..., 0.75, 0, 2, 0, 8) |
| 198 >>> computeClearMOT([gt2, gt1], [o2, o1], 0.2, 0, 3) # doctest:+ELLIPSIS | 219 >>> computeClearMOT([gt2, gt1], [o2, o1], 0.2, 0, 3) # doctest:+ELLIPSIS |
| 199 (0.1..., 0.75, 0, 2, 0, 8) | 220 (0.1..., 0.75, 0, 2, 0, 8) |
