Mercurial Hosting > traffic-intelligence
comparison scripts/display-trajectories.py @ 385:1917db662aa7
added rescaling options to scripts play-video and display-trajectories
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Mon, 22 Jul 2013 18:33:47 -0400 |
parents | a50a69e04c2a |
children | eaf7765221d9 |
comparison
equal
deleted
inserted
replaced
384:6da9cf5609aa | 385:1917db662aa7 |
---|---|
12 parser.add_argument('-d', dest = 'databaseFilename', help = 'name of the Sqlite database file') | 12 parser.add_argument('-d', dest = 'databaseFilename', help = 'name of the Sqlite database file') |
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 | 18 |
18 args = parser.parse_args() | 19 args = parser.parse_args() |
19 | 20 |
20 homography = None | 21 homography = None |
21 if args.configFilename: # consider there is a configuration file | 22 if args.configFilename: # consider there is a configuration file |
34 homography = inv(loadtxt(args.homography)) | 35 homography = inv(loadtxt(args.homography)) |
35 if args.firstFrameNum != None: | 36 if args.firstFrameNum != None: |
36 firstFrameNum = args.firstFrameNum | 37 firstFrameNum = args.firstFrameNum |
37 | 38 |
38 objects = storage.loadTrajectoriesFromSqlite(databaseFilename, args.trajectoryType) | 39 objects = storage.loadTrajectoriesFromSqlite(databaseFilename, args.trajectoryType) |
39 cvutils.displayTrajectories(videoFilename, objects, homography, firstFrameNum) | 40 cvutils.displayTrajectories(videoFilename, objects, homography, firstFrameNum, rescale = args.rescale) |