Mercurial > hg > nsaunier > traffic-intelligence
comparison scripts/display-trajectories.py @ 478:d337bffd7283
Display of points in compute homography and step option to replay videos
A bug seems to remain with respect to trajectory bounds, to check
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Thu, 27 Mar 2014 11:40:28 -0400 |
| parents | eaf7765221d9 |
| children | f6415f012640 |
comparison
equal
deleted
inserted
replaced
| 477:ed4166b0ba9d | 478:d337bffd7283 |
|---|---|
| 13 parser.add_argument('-i', dest = 'videoFilename', help = 'name of the video file') | 13 parser.add_argument('-i', dest = 'videoFilename', help = 'name of the video file') |
| 14 parser.add_argument('-t', dest = 'trajectoryType', help = 'type of trajectories to display', choices = ['feature', 'object'], default = 'feature') | 14 parser.add_argument('-t', dest = 'trajectoryType', help = 'type of trajectories to display', choices = ['feature', 'object'], default = 'feature') |
| 15 parser.add_argument('-o', dest = 'homography', help = 'name of the image to world homography') | 15 parser.add_argument('-o', dest = 'homography', help = 'name of the image to world homography') |
| 16 parser.add_argument('-f', dest = 'firstFrameNum', help = 'number of first frame number to display', default = 0, type = int) | 16 parser.add_argument('-f', dest = 'firstFrameNum', help = 'number of first frame number to display', default = 0, type = int) |
| 17 parser.add_argument('-r', dest = 'rescale', help = 'rescaling factor for the displayed image', default = 1., type = float) | 17 parser.add_argument('-r', dest = 'rescale', help = 'rescaling factor for the displayed image', default = 1., type = float) |
| 18 parser.add_argument('-s', dest = 'nFramesStep', help = 'number of frames between each display', default = 1, type = int) | |
| 18 | 19 |
| 19 args = parser.parse_args() | 20 args = parser.parse_args() |
| 20 | 21 |
| 21 homography = None | 22 homography = None |
| 22 if args.configFilename: # consider there is a configuration file | 23 if args.configFilename: # consider there is a configuration file |
| 36 if args.firstFrameNum != None: | 37 if args.firstFrameNum != None: |
| 37 firstFrameNum = args.firstFrameNum | 38 firstFrameNum = args.firstFrameNum |
| 38 | 39 |
| 39 objects = storage.loadTrajectoriesFromSqlite(databaseFilename, args.trajectoryType) | 40 objects = storage.loadTrajectoriesFromSqlite(databaseFilename, args.trajectoryType) |
| 40 boundingBoxes = storage.loadBoundingBoxTable(databaseFilename) | 41 boundingBoxes = storage.loadBoundingBoxTable(databaseFilename) |
| 41 cvutils.displayTrajectories(videoFilename, objects, boundingBoxes, homography, firstFrameNum, rescale = args.rescale) | 42 cvutils.displayTrajectories(videoFilename, objects, boundingBoxes, homography, firstFrameNum, rescale = args.rescale, nFramesStep = args.nFramesStep) |
