# HG changeset patch # User Nicolas Saunier # Date 1467222621 14400 # Node ID 0ddcc41663f545dac6e66c61481395251879971d # Parent 14e4ad7c742044e5a0d8dc40e8b74b695982d3fd renaming diff -r 14e4ad7c7420 -r 0ddcc41663f5 python/storage.py --- a/python/storage.py Tue Jun 28 17:18:45 2016 -0400 +++ b/python/storage.py Wed Jun 29 13:50:21 2016 -0400 @@ -283,7 +283,7 @@ print('List of missing objects to attach corresponding curvilinear trajectories: {}'.format(missingObjectNumbers)) def saveTrajectoriesToSqlite(outputFilename, objects, trajectoryType, withFeatures = False): - '''Writes features, ie the trajectories positions (and velocities if exist) + '''Writes features, ie the trajectory positions (and velocities if exist) with their instants to a specified sqlite file Either feature positions (and velocities if they exist) or curvilinear positions will be saved at a time @@ -793,7 +793,7 @@ s = readline(f, commentCharacters) return dataStrings -def writeList(filename, l): +def saveList(filename, l): f = openCheck(filename, 'w') for x in l: f.write('{}\n'.format(x)) @@ -1108,7 +1108,7 @@ out.close() -def writePositionsToCsv(f, obj): +def savePositionsToCsv(f, obj): timeInterval = obj.getTimeInterval() positions = obj.getPositions() curvilinearPositions = obj.getCurvilinearPositions() @@ -1120,10 +1120,10 @@ s += ',{},{}'.format(p2[0],p2[1]) f.write(s+'\n') -def writeTrajectoriesToCsv(filename, objects): +def saveTrajectoriesToCsv(filename, objects): f = openCheck(filename, 'w') for i,obj in enumerate(objects): - writePositionsToCsv(f, obj) + savePositionsToCsv(f, obj) f.close() diff -r 14e4ad7c7420 -r 0ddcc41663f5 scripts/merge-features.py --- a/scripts/merge-features.py Tue Jun 28 17:18:45 2016 -0400 +++ b/scripts/merge-features.py Wed Jun 29 13:50:21 2016 -0400 @@ -40,6 +40,12 @@ commonTimeInterval = moving.TimeInterval.intersection(commonTimeInterval, inter) commonTimeInterval = moving.TimeInterval.intersection(commonTimeInterval, processInterval) +if len(set([cv.cameraType.frameRate for cv in cameraViews])) > 1: + print('Different framerates of the cameras ({}) are not handled yet. Exiting'.format([cv.cameraType.frameRate for cv in cameraViews])) + +for cv, v in videoSequences.iteritems(): + + # for all camera view, for all video, select from positions and velocities where frame_number is in the right range and insert in new database # should we save the information of the new "sequence" in the metadata?