Advertisement
Guest User

Untitled

a guest
Aug 12th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. import cv2
  2. video = cv2.VideoCapture('Town.avi')
  3. while video.isOpened():
  4. ret, frame = video.read()
  5. # cvtColor in opencv is used to change colorspace
  6. grayscale = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
  7. cv2.imshow('Orignal', frame)
  8. cv2.imshow('Gray', grayscale)
  9. cv2.waitKey(1)
  10.  
  11. video.release()
  12. cv2.destroyAllWindows()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement