Mercurial Hosting > traffic-intelligence
diff scripts/display-trajectories.py @ 364:a50a69e04c2a
script modification so that command line arguments take precedence over config file
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Fri, 12 Jul 2013 02:29:49 -0400 |
parents | 7b865f4174aa |
children | 1917db662aa7 |
line wrap: on
line diff
--- a/scripts/display-trajectories.py Fri Jul 12 01:26:22 2013 -0400 +++ b/scripts/display-trajectories.py Fri Jul 12 02:29:49 2013 -0400 @@ -17,6 +17,7 @@ args = parser.parse_args() +homography = None if args.configFilename: # consider there is a configuration file params = utils.TrackingParameters() params.loadConfigFile(args.configFilename) @@ -24,12 +25,14 @@ databaseFilename = params.databaseFilename homography = inv(params.homography) firstFrameNum = params.firstFrameNum -else: + +if args.videoFilename != None: videoFilename = args.videoFilename +if args.databaseFilename != None: databaseFilename = args.databaseFilename - homography = None - if args.homography: - homography = inv(loadtxt(args.homography)) +if args.homography != None: + homography = inv(loadtxt(args.homography)) +if args.firstFrameNum != None: firstFrameNum = args.firstFrameNum objects = storage.loadTrajectoriesFromSqlite(databaseFilename, args.trajectoryType)