1import numpy as np
2import cv2
3cap = cv2.VideoCapture('videos/wa.avi')
4while(cap.isOpened()):
5 ret, frame = cap.read()
6 gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
7 cv2.imshow('frame',gray)
8 if cv2.waitKey(1) & 0xFF == ord('q'):
9 break
10
11cap.release()
12cv2.destroyAllWindows()
1import cv2
2frameWidth = 640
3frameHeight = 480
4cap = cv2.VideoCapture("Resources/test_ video.mp4")
5while True:
6 success, img = cap.read()
7 img = cv2.resize(img, (frameWidth, frameHeight))
8 cv2.imshow("Result", img)
9 if cv2.waitKey(1) and 0xFF == ord('q'):
10 break
11