changeset 1133:c4d9c270f999

modification for performance computation
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Wed, 26 Feb 2020 22:39:36 -0500
parents 09ef0dc994a0
children 4b2a55d570c1
files trafficintelligence/moving.py trafficintelligence/storage.py trafficintelligence/tests/moving.txt
diffstat 3 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/trafficintelligence/moving.py	Wed Feb 26 22:32:39 2020 -0500
+++ b/trafficintelligence/moving.py	Wed Feb 26 22:39:36 2020 -0500
@@ -2034,7 +2034,7 @@
         nTOs = len(matchedTOs)+len(unmatchedTOs)
         if len(unmatchedTOs) > 0:
             for a in unmatchedGTs:
-                costs.append([a.matches(o, t, matchingDistance) for o in unmatchedTOs])
+                costs.append([a.motDistanceAtInstant(o, t) for o in unmatchedTOs])
         if len(costs) > 0:
             newMatches = munk.compute(costs)
             for k,v in newMatches:
--- a/trafficintelligence/storage.py	Wed Feb 26 22:32:39 2020 -0500
+++ b/trafficintelligence/storage.py	Wed Feb 26 22:39:36 2020 -0500
@@ -474,7 +474,7 @@
                 for t, b in zip(topCorners, bottomCorners):
                     num = t.getNum()
                     if t.getNum() == b.getNum():
-                        annotation = moving.BBMovingObject(num, t.getTimeInterval(), t, b, userTypes[num])
+                        annotation = moving.BBMovingObject(num, t, b, t.getTimeInterval(), userTypes[num])
                         objects.append(annotation)
             else:
                 print ('Unknown type of bounding box {}'.format(objectType))
--- a/trafficintelligence/tests/moving.txt	Wed Feb 26 22:32:39 2020 -0500
+++ b/trafficintelligence/tests/moving.txt	Wed Feb 26 22:39:36 2020 -0500
@@ -298,7 +298,7 @@
 'pedestrian'
 
 >>> o1 = MovingObject.generate(1, Point(0.,0.), Point(1.,0.), TimeInterval(0,10))
->>> gt1 = BBMovingObject(1, TimeInterval(0,10), MovingObject.generate(1, Point(0.2,0.6), Point(1.,0.), TimeInterval(0,10)), MovingObject.generate(2, Point(-0.2,-0.4), Point(1.,0.), TimeInterval(0,10)))
+>>> gt1 = BBMovingObject(MovingObject.generate(1, Point(0.2,0.6), Point(1.,0.), TimeInterval(0,10)), MovingObject.generate(2, Point(-0.2,-0.4), Point(1.,0.), TimeInterval(0,10)), 1, TimeInterval(0,10), )
 >>> gt1.computeCentroidTrajectory()
 >>> computeClearMOT([gt1], [], 0.2, 0, 10)
 (None, 0.0, 11, 0, 0, 11, None, None)
@@ -311,9 +311,9 @@
 
 >>> o1 = MovingObject(1, TimeInterval(0,3), positions = Trajectory([list(range(4)), [0.1, 0.1, 1.1, 1.1]]))
 >>> o2 = MovingObject(2, TimeInterval(0,3), positions = Trajectory([list(range(4)), [0.9, 0.9, -0.1, -0.1]]))
->>> gt1 = BBMovingObject(1, TimeInterval(0,3), MovingObject(positions = Trajectory([list(range(4)), [0.]*4])), MovingObject(positions = Trajectory([list(range(4)), [0.]*4])))
+>>> gt1 = BBMovingObject(MovingObject(positions = Trajectory([list(range(4)), [0.]*4])), MovingObject(positions = Trajectory([list(range(4)), [0.]*4])), 1, TimeInterval(0,3))
 >>> gt1.computeCentroidTrajectory()
->>> gt2 = BBMovingObject(2, TimeInterval(0,3), MovingObject(positions = Trajectory([list(range(4)), [1.]*4])), MovingObject(positions = Trajectory([list(range(4)), [1.]*4])))
+>>> gt2 = BBMovingObject(MovingObject(positions = Trajectory([list(range(4)), [1.]*4])), MovingObject(positions = Trajectory([list(range(4)), [1.]*4])), 2, TimeInterval(0,3))
 >>> gt2.computeCentroidTrajectory()
 >>> computeClearMOT([gt1, gt2], [o1, o2], 0.2, 0, 3) # doctest:+ELLIPSIS
 (0.1..., 0.75, 0, 2, 0, 8, None, None)