comparison scripts/dltrack.py @ 1306:4bc0651d91f9 default tip

bug corrected generating last velocity twice and saving it (not saved, duplicated at loading time
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Mon, 30 Mar 2026 15:31:34 -0400
parents f4d4bb9ec34f
children
comparison
equal deleted inserted replaced
1305:9c1870244adf 1306:4bc0651d91f9
256 projected = cvutils.imageToWorldProject(np.array(t).T, intrinsicCameraMatrix, distortionCoefficients, homography) 256 projected = cvutils.imageToWorldProject(np.array(t).T, intrinsicCameraMatrix, distortionCoefficients, homography)
257 featureNum = features[0].getNum() 257 featureNum = features[0].getNum()
258 feature = moving.MovingObject(featureNum, obj.getTimeInterval(), moving.Trajectory(projected.tolist())) 258 feature = moving.MovingObject(featureNum, obj.getTimeInterval(), moving.Trajectory(projected.tolist()))
259 if smoothingHalfWidth is not None: # smoothing 259 if smoothingHalfWidth is not None: # smoothing
260 feature.smoothPositions(smoothingHalfWidth, replace = True)#f.positions = f.getPositions().filterMovingWindow(smoothingHalfWidth) 260 feature.smoothPositions(smoothingHalfWidth, replace = True)#f.positions = f.getPositions().filterMovingWindow(smoothingHalfWidth)
261 feature.computeVelocities() 261 feature.computeVelocities(duplicateLastVelocity = False)
262 obj.features=[feature] 262 obj.features=[feature]
263 obj.featureNumbers = [featureNum] 263 obj.featureNumbers = [featureNum]
264 #saving 264 #saving
265 storage.saveTrajectoriesToSqlite(databaseFilename, list(objects.values()), 'object') 265 storage.saveTrajectoriesToSqlite(databaseFilename, list(objects.values()), 'object')
266 266