comparison scripts/display-trajectories.py @ 981:c3e690c5536e

corrected bug in display trajectories
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Tue, 27 Feb 2018 15:24:57 -0500
parents c69a8defe5c3
children 933670761a57
comparison
equal deleted inserted replaced
980:23f98ebb113f 981:c3e690c5536e
21 parser.add_argument('-l', dest = 'lastFrameNum', help = 'number of last frame number to save (for image saving, no display is made)', type = int) 21 parser.add_argument('-l', dest = 'lastFrameNum', help = 'number of last frame number to save (for image saving, no display is made)', type = int)
22 parser.add_argument('-r', dest = 'rescale', help = 'rescaling factor for the displayed image', default = 1., type = float) 22 parser.add_argument('-r', dest = 'rescale', help = 'rescaling factor for the displayed image', default = 1., type = float)
23 parser.add_argument('-s', dest = 'nFramesStep', help = 'number of frames between each display', default = 1, type = int) 23 parser.add_argument('-s', dest = 'nFramesStep', help = 'number of frames between each display', default = 1, type = int)
24 parser.add_argument('-n', dest = 'nObjects', help = 'number of objects to display', type = int) 24 parser.add_argument('-n', dest = 'nObjects', help = 'number of objects to display', type = int)
25 parser.add_argument('--save-images', dest = 'saveAllImages', help = 'save all images', action = 'store_true') 25 parser.add_argument('--save-images', dest = 'saveAllImages', help = 'save all images', action = 'store_true')
26 parser.add_argument('--nzeros', dest = 'nZerosFilenameArg', help = 'number of digits in filenames', type = int)
26 27
27 args = parser.parse_args() 28 args = parser.parse_args()
28 29
29 params, videoFilename, databaseFilename, invHomography, intrinsicCameraMatrix, distortionCoefficients, undistortedImageMultiplication, undistort, firstFrameNum = storage.processVideoArguments(args) 30 params, videoFilename, databaseFilename, invHomography, intrinsicCameraMatrix, distortionCoefficients, undistortedImageMultiplication, undistort, firstFrameNum = storage.processVideoArguments(args)
30 31
43 else: 44 else:
44 nObjects = None 45 nObjects = None
45 46
46 objects = storage.loadTrajectoriesFromSqlite(databaseFilename, args.trajectoryType, nObjects) 47 objects = storage.loadTrajectoriesFromSqlite(databaseFilename, args.trajectoryType, nObjects)
47 boundingBoxes = storage.loadBoundingBoxTableForDisplay(databaseFilename) 48 boundingBoxes = storage.loadBoundingBoxTableForDisplay(databaseFilename)
48 cvutils.displayTrajectories(videoFilename, objects, boundingBoxes, invHomography, firstFrameNum, args.lastFrameNum, rescale = args.rescale, nFramesStep = args.nFramesStep, saveAllImages = args.saveAllImages, undistort = (undistort or args.undistort), intrinsicCameraMatrix = intrinsicCameraMatrix, distortionCoefficients = distortionCoefficients, undistortedImageMultiplication = undistortedImageMultiplication) 49 cvutils.displayTrajectories(videoFilename, objects, boundingBoxes, invHomography, firstFrameNum, args.lastFrameNum, rescale = args.rescale, nFramesStep = args.nFramesStep, saveAllImages = args.saveAllImages, nZerosFilenameArg = args.nZerosFilenameArg, undistort = (undistort or args.undistort), intrinsicCameraMatrix = intrinsicCameraMatrix, distortionCoefficients = distortionCoefficients, undistortedImageMultiplication = undistortedImageMultiplication)