diff trafficintelligence/storage.py @ 1246:2397de73770d

dltrack saves after projecting coordinates
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Fri, 09 Feb 2024 17:47:33 -0500
parents 371c718e57d7
children 2aa56b101041
line wrap: on
line diff
--- a/trafficintelligence/storage.py	Thu Feb 08 16:10:54 2024 -0500
+++ b/trafficintelligence/storage.py	Fri Feb 09 17:47:33 2024 -0500
@@ -1652,6 +1652,7 @@
         self.minFeatureEigThreshold = config.getfloat(self.sectionHeader, 'min-feature-eig-threshold')
         self.minFeatureTime = config.getint(self.sectionHeader, 'min-feature-time')
         self.minFeatureDisplacement = config.getfloat(self.sectionHeader, 'min-feature-displacement')
+        self.smoothingHalfWidth = config.getfloat(self.sectionHeader, 'smoothing-halfwidth')
         #self.updateTimer = config.getint(self.sectionHeader, 'tracker-reload-time')
         
 
@@ -1672,8 +1673,10 @@
         videoFilename = params.videoFilename
         databaseFilename = params.databaseFilename
         if params.homography is not None:
+            homography = params.homography
             invHomography = linalg.inv(params.homography)
         else:
+            homography = None
             invHomography = None
         intrinsicCameraMatrix = params.intrinsicCameraMatrix
         distortionCoefficients = array(params.distortionCoefficients)
@@ -1682,6 +1685,7 @@
         firstFrameNum = params.firstFrameNum
     else:
         params = None
+        homography = None
         invHomography = None
         undistort = False
         intrinsicCameraMatrix = None
@@ -1700,7 +1704,7 @@
     else:
         databaseFilename = params.databaseFilename
 
-    return params, videoFilename, databaseFilename, invHomography, intrinsicCameraMatrix, distortionCoefficients, undistortedImageMultiplication, undistort, firstFrameNum
+    return params, videoFilename, databaseFilename, homography, invHomography, intrinsicCameraMatrix, distortionCoefficients, undistortedImageMultiplication, undistort, firstFrameNum
     
 # deprecated
 class SceneParameters(object):