SHARE
TWEET

Untitled

a guest Aug 12th, 2017 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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()
RAW Paste Data
Top