Implemented goal detection in colorpicker

This commit is contained in:
2018-06-10 21:04:20 +02:00
parent caf88ab7e7
commit abc69fb69a
4 changed files with 98 additions and 11 deletions

View File

@@ -62,9 +62,10 @@ class VideoReader(object):
if not succ:
raise ValueError('Error while reading video')
self.ctr += 1
if self.ctr == self.cap.get(cv2.CAP_PROP_FRAME_COUNT) and self.loop:
if (self.ctr == self.cap.get(cv2.cv.CV_CAP_PROP_FRAME_COUNT) and
self.loop):
self.ctr = 0
self.cap.set(cv2.CAP_PROP_POS_FRAMES, 0)
self.cap.set(cv2.cv.CV_CAP_PROP_POS_FRAMES, 0)
return frame
def close(self):