Guest User

Untitled

a guest
Jul 21st, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. def getGrayImageFromeVideo(videoPath):
  2. video_cap = cv2.VideoCapture(videoPath)
  3. frame_count = 0
  4. all_frames = []
  5.  
  6. while(True):
  7. ret, frame = video_cap.read()
  8. if ret is False:
  9. break
  10.  
  11. frame_gray = np.array(cv2.cvtColor(frame, cv2.COLOR_RGB2GRAY))
  12. all_frames.append(frame_gray)
  13. frame_count += 1
  14.  
  15. return all_frames, frame_count
Add Comment
Please, Sign In to add comment