Mercurial Hosting > traffic-intelligence
diff scripts/polytracktopdtv.py @ 1012:01db14e947e4
resolved
author | Wendlasida |
---|---|
date | Fri, 01 Jun 2018 10:47:49 -0400 |
parents | 933670761a57 |
children | cc5cb04b04b0 |
line wrap: on
line diff
--- a/scripts/polytracktopdtv.py Fri Jun 01 10:43:23 2018 -0400 +++ b/scripts/polytracktopdtv.py Fri Jun 01 10:47:49 2018 -0400 @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 from pdtv import TsaiCamera, ZipVideo, SyncedVideos, TrackSet, Track, State import sys, os, datetime, argparse @@ -68,7 +68,6 @@ frameList = cvutils.getImagesFromVideo(videoFile, firstFrameNum = currentIdx, nFrames = inc) while len(frameList) == inc and inc > 0: - for f in frameList: cv2.imwrite(os.path.join(framePath,time.strftime("%Y%m%d-%H%M%S.%f")[:-3]+'.jpg'), f) time += datetime.timedelta(microseconds=deltaTimestamp*1000) @@ -80,7 +79,7 @@ inc = delta if inc: frameList = cvutils.getImagesFromVideo(videoFile, firstFrameNum = currentIdx, nFrames = inc) - print('Extracting frame ' + str(currentIdx)) + print('Extracting frame {}'.format(currentIdx)) return len(frameList) > 0 @@ -115,7 +114,7 @@ if videoFile is not None: fps = cvutils.getFPS(videoFile) - print('Video should run at ' + str(fps) + ' fps') + print('Video should run at {} fps'.format(fps)) deltaTimestamp = 1000.0/float(fps); if videoFolderExist == False: if os.path.exists(videoFolderPath):