Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
import cv2

cap = cv2.VideoCapture(0)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 1080)
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 1920)

cv2.namedWindow('frame', cv2.WINDOW_AUTOSIZE)
while(True):
    ret, frame = cap.read()

    # Display the resulting frame
    cv2.imshow('frame',frame)

    if cv2.waitKey(1) & 0xFF == ord('q'):
        break#Display resulting frame

#when everything done, release the capture
cap.release()
cv2.destroyAllWindows()