did small refactoring, probably broke a lot

This commit is contained in:
2018-06-13 22:11:58 +02:00
parent b8ccb41ba7
commit 5076f87145
3 changed files with 67 additions and 95 deletions

View File

@@ -60,7 +60,8 @@ class VideoReader(object):
def get_frame(self):
succ, frame = self.cap.read()
if not succ:
raise ValueError('Error while reading video')
raise ValueError('Error while reading video.\n' +
'Or video is over.')
self.ctr += 1
if (self.ctr == self.cap.get(cv2.cv.CV_CAP_PROP_FRAME_COUNT) and
self.loop):