A series of convenience functions to make basic image processing operations such as translation, rotation, resizing, skeletonization, and displaying Matplotlib images easier with OpenCV and Python.
The count frames function currently will resort to using manual counting instead of the cv2.CAP_PROP_FRAME_COUNT property if you use version 4+ of OpenCV. From imutils/video/count_frames.py:
try:
# check if we are using OpenCV 3
if is_cv3():
total = int(video.get(cv2.CAP_PROP_FRAME_COUNT))
# otherwise, we are using OpenCV 2.4
else:
total = int(video.get(cv2.cv.CV_CAP_PROP_FRAME_COUNT))
I believe that if OpenCV 4 using the same property as OpenCV 3, so this should be as simple as changing the if statement to check if cv3 or cv4. Is there already a convenience function for checking version 4 that could be used here?
The count frames function currently will resort to using manual counting instead of the
cv2.CAP_PROP_FRAME_COUNT
property if you use version 4+ of OpenCV. Fromimutils/video/count_frames.py
:I believe that if OpenCV 4 using the same property as OpenCV 3, so this should be as simple as changing the if statement to check if cv3 or cv4. Is there already a convenience function for checking version 4 that could be used here?