changeset 226:91197f6a03fe

added goto framenum
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Tue, 26 Jun 2012 10:15:11 -0400
parents d4d3b1e8a9f1
children b7612c6d5702
files python/cvutils.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/python/cvutils.py	Tue Jun 26 03:37:19 2012 -0400
+++ b/python/cvutils.py	Tue Jun 26 10:15:11 2012 -0400
@@ -97,10 +97,13 @@
         capture = cv2.VideoCapture(filename)
         if capture.isOpened():
             key = -1
-            capture.set(CV_CAP_PROP_POS_FRAMES, firstFrame)
+            frameNum = 1
+            capture.set(cv2.cv.CV_CAP_PROP_POS_FRAMES, firstFrame)
             while key!= 113: # 'q'
                 ret, img = capture.read()
                 if ret:
+                    print('frame {0}'.format(frameNum))
+                    frameNum+=1
                     cv2.imshow('frame', img)
                     key = cv2.waitKey(5)