Mercurial Hosting > traffic-intelligence
changeset 858:2faabcbde2c4
minor improvements
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Tue, 11 Oct 2016 17:57:50 -0400 |
parents | 6d89520e269f |
children | a8de3c93f6b7 |
files | python/cvutils.py scripts/init_tracking.py |
diffstat | 2 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/python/cvutils.py Thu Oct 06 17:16:31 2016 -0400 +++ b/python/cvutils.py Tue Oct 11 17:57:50 2016 -0400 @@ -244,7 +244,7 @@ ret = False capture.set(cv2.cv.CV_CAP_PROP_POS_FRAMES, firstFrameNum) frameNum = firstFrameNum - while frameNum<=lastFrameNum and frameNum<rawCount: + while frameNum<lastFrameNum and frameNum<rawCount: ret, img = capture.read() i = 0 while not ret and i<10:
--- a/scripts/init_tracking.py Thu Oct 06 17:16:31 2016 -0400 +++ b/scripts/init_tracking.py Tue Oct 11 17:57:50 2016 -0400 @@ -1,6 +1,7 @@ #! /usr/bin/env python import sys, argparse, os.path, storage, utils +from shutil import copy from cvutils import getImagesFromVideo from matplotlib.pyplot import imsave @@ -39,7 +40,10 @@ f.close() out.close() print('Configuration file tracking.cfg successfully copied to the current directory with video and database filename adapted') - + if os.path.exists(directoryName+'/../classifier.cfg') and not os.path.exists('./classifier.cfg'): + copy(directoryName+'/../classifier.cfg', 'classifier.cfg') + print('Configuration file classifier.cfg successfully copied to the current directory') + # extract image from video image = getImagesFromVideo(args.videoFilename, saveImage = True, outputPrefix = 'frame') print('first video frame successfully copied to the current directory')