Advertisement
Guest User

Untitled

a guest
Sep 20th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. import cv2
  2. import datetime
  3. import time
  4. cap = cv2.VideoCapture(0)
  5. while(1):
  6. times = datetime.datetime.now()
  7.  
  8. # get a frame
  9. ret, frame = cap.read()
  10. # show a frame
  11. #cv2.imshow("capture", frame)
  12.  
  13. loca="/home/u/pic/"+str(times.year)+str(times.month)+str(times.day)+str(times.hour)+str(times.minute)+str(times.secon$ print(loca)
  14. cv2.imwrite(loca, frame)
  15. time.sleep(1)
  16. cv2.destroyAllWindows()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement