diff trafficintelligence/storage.py @ 1207:36f0d18e1fad

work in progress on loading kitti (issue with int)
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Wed, 26 Apr 2023 18:33:29 -0400
parents 3905b393ade0
children af329f3330ba
line wrap: on
line diff
--- a/trafficintelligence/storage.py	Wed Mar 22 23:29:09 2023 -0400
+++ b/trafficintelligence/storage.py	Wed Apr 26 18:33:29 2023 -0400
@@ -1313,7 +1313,7 @@
     
     header = ['frame', # 0, 1, ..., n
               'trackingid', # -1, 0 , 1, ..., k
-              'type',  # 'Car', 'Pedestrian', ...
+              'usertype',  # 'Car', 'Pedestrian', ...
               'truncation', # truncated pixel ratio [0..1]
               'occlusion', # 0=visible, 1=partly occluded, 2=fully occluded, 3=unknown
               'alpha', # object observation angle [-pi..pi]
@@ -1381,7 +1381,8 @@
             for i in range(4):
                 featureTrajectories[i].addPositionXY(xCoords[i], yCoords[i])                
             # check https://docs.opencv.org/3.4/d9/d0c/group__calib3d.html#ga1019495a2c8d1743ed5cc23fa0daff8c
-        newObj = moving.MovingObject(num = objNum, timeInterval = moving.TimeInterval(int(tmp.frame.min()), int(tmp.frame.max())), positions = t, userType = tmp.iloc[0].type, features = [moving.MovingObject(num = featureNum+i, timeInterval = moving.TimeInterval(int(tmp.frame.min()), int(tmp.frame.max())), positions = featureTrajectories[i]) for i in range(4)])
+        
+        newObj = moving.MovingObject(num = objNum, timeInterval = moving.TimeInterval(int(tmp.frame.min()), int(tmp.frame.max())), positions = t, velocities = t.differentiate(True), userType = tmp.iloc[0].usertype, features = [moving.MovingObject(num = featureNum+i, timeInterval = moving.TimeInterval(int(tmp.frame.min()), int(tmp.frame.max())), positions = featureTrajectories[i], velocities = featureTrajectories[i].differentiate(True)) for i in range(4)])
         objects.append(newObj)
         featureNum += 4
     return objects