I am only able to capture small images with my webcam using opencv2 even though I can see higher resoution using cheese and over the command line uvcdynctrl (see output at bottom).
Here is my python code which works on a raspberry pi, but not on my laptop.
import cv2
cap = cv2.VideoCapture(0)
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 640)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 480)
width = cap.get(cv2.CAP_PROP_FRAME_WIDTH)
height = cap.get(cv2.CAP_PROP_FRAME_HEIGHT)
print(width, height)
### outputs 176.0 144.0
(base) ~/code/CaptureQueen$ uvcdynctrl -f
Listing available frame formats for device video0:
Pixel format: MJPG (Motion-JPEG; MIME type: image/jpeg)
Frame size: 160x120
Frame rates: 30, 25, 20, 15, 10, 5
Frame size: 176x144
Frame rates: 30, 25, 20, 15, 10, 5
Frame size: 320x240
Frame rates: 30, 25, 20, 15, 10, 5
Frame size: 352x288
Frame rates: 30, 25, 20, 15, 10, 5
Frame size: 640x480
Frame rates: 30, 25, 20, 15, 10, 5
Frame size: 800x600
Frame rates: 15, 10, 5
Pixel format: YUYV (YUYV 4:2:2; MIME type: video/x-raw-yuv)
Frame size: 160x120
Frame rates: 15, 10, 5
Frame size: 176x144
Frame rates: 15, 10, 5