import cv2 import time cap = cv2.VideoCapture(0) def takephoto(): ret, frame = cap.read() frame = cv2.resize(frame, (1936, 1096)) cv2.imwrite("capture.png", frame) cap.release() takephoto()