opencv_get_photo1.py 220 B

1234567891011
  1. import cv2
  2. import time
  3. cap = cv2.VideoCapture(0)
  4. def takephoto():
  5. ret, frame = cap.read()
  6. frame = cv2.resize(frame, (1936, 1096))
  7. cv2.imwrite("capture.png", frame)
  8. cap.release()
  9. takephoto()