going in the right direction.

This commit is contained in:
didier amyot committed 2024-01-20 19:13:58 -05:00
1 parent b69b33ee59
commit d716ba80f7
4 files changed
+135 -3

No files matched your search

+17 -3
View File
@@ -1,5 +1,19 @@
import cv2 as cv
img = cv.imread("/Users/didier/ahuntsic/cours-420-301-ah/cours/images/json/001.jpg")
cv.imshow("Display window", img)
k = cv.waitKey(0) # Wait for a keystroke in the window
minute = 60
video_start = 9 * minute + 30
video_end = 12 * minute + 56
cap = cv.VideoCapture('out.mp4')
while cap.isOpened():
ret, frame = cap.read()
# if frame is read correctly ret is True
if not ret:
print("Can't receive frame (stream end?). Exiting ...")
break
gray = cv.cvtColor(frame, cv.COLOR_BGR2GRAY)
cv.imshow('frame', gray)
if cv.waitKey(1) == ord('q'):
break
cap.release()
cv.destroyAllWindows()