Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import cv2
- import time
- cap = cv2.VideoCapture(0)
- val = 0
- while(True):
- filename = 'capture' + str(val) + '.jpg'
- ret, frame = cap.read()
- rgb = cv2.cvtColor(frame, cv2.COLOR_BGR2BGRA)
- out = cv2.imwrite(filename, frame)
- print('File: ' + filename)
- val += 1
- if(val > 10)
- break
- time.sleep(5)
- cap.release()
- cv2.destroyAllWindows()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement