comparison scripts/dltrack.py @ 1270:20a5e1292321

added smoothing functions and velocity generation to dltrack
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Mon, 10 Jun 2024 16:44:19 -0400
parents 27b206d118b7
children b2f90cada58f
comparison
equal deleted inserted replaced
1269:ca70a79688ae 1270:20a5e1292321
254 obj.features=[moving.MovingObject(featureNum, obj.getTimeInterval(), moving.Trajectory(projected.tolist()))] 254 obj.features=[moving.MovingObject(featureNum, obj.getTimeInterval(), moving.Trajectory(projected.tolist()))]
255 obj.featureNumbers = [featureNum] 255 obj.featureNumbers = [featureNum]
256 if smoothingHalfWidth is not None: # smoothing 256 if smoothingHalfWidth is not None: # smoothing
257 for num, obj in objects.items(): 257 for num, obj in objects.items():
258 for f in obj.getFeatures(): 258 for f in obj.getFeatures():
259 f.positions = f.getPositions().filterMovingWindow(smoothingHalfWidth) 259 f.smoothPositions(smoothingHalfWidth, replace = True)#f.positions = f.getPositions().filterMovingWindow(smoothingHalfWidth)
260 f.computeVelocities()
260 storage.saveTrajectoriesToSqlite(args.databaseFilename, list(objects.values()), 'object') 261 storage.saveTrajectoriesToSqlite(args.databaseFilename, list(objects.values()), 'object')
261 262
262 263
263 264
264 # todo save bbox and mask to study localization / representation 265 # todo save bbox and mask to study localization / representation