comparison scripts/init_tracking.py @ 858:2faabcbde2c4

minor improvements
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Tue, 11 Oct 2016 17:57:50 -0400
parents d45ab817ee11
children
comparison
equal deleted inserted replaced
857:6d89520e269f 858:2faabcbde2c4
1 #! /usr/bin/env python 1 #! /usr/bin/env python
2 2
3 import sys, argparse, os.path, storage, utils 3 import sys, argparse, os.path, storage, utils
4 from shutil import copy
4 from cvutils import getImagesFromVideo 5 from cvutils import getImagesFromVideo
5 from matplotlib.pyplot import imsave 6 from matplotlib.pyplot import imsave
6 7
7 # could try to guess the video 8 # could try to guess the video
8 # check if there is already a tracking.cfg file 9 # check if there is already a tracking.cfg file
37 else: 38 else:
38 out.write(l) 39 out.write(l)
39 f.close() 40 f.close()
40 out.close() 41 out.close()
41 print('Configuration file tracking.cfg successfully copied to the current directory with video and database filename adapted') 42 print('Configuration file tracking.cfg successfully copied to the current directory with video and database filename adapted')
42 43 if os.path.exists(directoryName+'/../classifier.cfg') and not os.path.exists('./classifier.cfg'):
44 copy(directoryName+'/../classifier.cfg', 'classifier.cfg')
45 print('Configuration file classifier.cfg successfully copied to the current directory')
46
43 # extract image from video 47 # extract image from video
44 image = getImagesFromVideo(args.videoFilename, saveImage = True, outputPrefix = 'frame') 48 image = getImagesFromVideo(args.videoFilename, saveImage = True, outputPrefix = 'frame')
45 print('first video frame successfully copied to the current directory') 49 print('first video frame successfully copied to the current directory')
46 50
47 # next commands 51 # next commands