why cv2 read() method giving cropped image from webcam?

cap = cv2.VideoCapture(0)
isError, frame = cap.read()
print(frame.shape) # output (480, 640, 3)

Whereas the normal webcam capture is of (720,1280) size. Note that I am not talking about ratio. The image I am getting from cv2 is actually cropped automatically!!!

How can I get the whole webcam image?

Answer

set() method can be used to change resolution of webcam.

cap = cv2.VideoCapture(0)
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 1280)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 720)

isError, frame = cap.read()
print(frame.shape) # output (720, 1280, 3)