comparison python/cvutils.py @ 538:bd1ad468e928

corrected bug and added capability to save undistorted image
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Thu, 03 Jul 2014 13:57:32 -0400
parents 5585ebd8ad61
children 749672171789 97c5fef5b2d6
comparison
equal deleted inserted replaced
537:6c264b914846 538:bd1ad468e928
142 cv2.putText(img, text, (10,50), cv2.cv.CV_FONT_HERSHEY_PLAIN, 1, cvRed) 142 cv2.putText(img, text, (10,50), cv2.cv.CV_FONT_HERSHEY_PLAIN, 1, cvRed)
143 cvImshow('frame', img, rescale) 143 cvImshow('frame', img, rescale)
144 key = cv2.waitKey(wait) 144 key = cv2.waitKey(wait)
145 cv2.destroyAllWindows() 145 cv2.destroyAllWindows()
146 else: 146 else:
147 print('Video capture for {} failed'.format(videoFilename)) 147 print('Video capture for {} failed'.format(filename))
148 148
149 def getImagesFromVideo(videoFilename, firstFrameNum = 0, nFrames = 1, saveImage = False, outputPrefix = 'image'): 149 def getImagesFromVideo(videoFilename, firstFrameNum = 0, nFrames = 1, saveImage = False, outputPrefix = 'image'):
150 '''Returns nFrames images from the video sequence''' 150 '''Returns nFrames images from the video sequence'''
151 from math import floor, log10 151 from math import floor, log10
152 images = [] 152 images = []