Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import cv2
- video = cv2.VideoCapture('Town.avi')
- while video.isOpened():
- ret, frame = video.read()
- # cvtColor in opencv is used to change colorspace
- grayscale = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
- cv2.imshow('Orignal', frame)
- cv2.imshow('Gray', grayscale)
- cv2.waitKey(1)
- video.release()
- cv2.destroyAllWindows()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement