-1
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?

Aayush Scet
  • 37
  • 1
  • 6
  • 1
    pls check this - [cv2 read image](https://stackoverflow.com/questions/19448078/python-opencv-access-webcam-maximum-resolution) there is good analysis in this post. – simpleApp Aug 14 '21 at 14:45

1 Answers1

0

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)
Aayush Scet
  • 37
  • 1
  • 6