Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def getGrayImageFromeVideo(videoPath):
- video_cap = cv2.VideoCapture(videoPath)
- frame_count = 0
- all_frames = []
- while(True):
- ret, frame = video_cap.read()
- if ret is False:
- break
- frame_gray = np.array(cv2.cvtColor(frame, cv2.COLOR_RGB2GRAY))
- all_frames.append(frame_gray)
- frame_count += 1
- return all_frames, frame_count
Add Comment
Please, Sign In to add comment