Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How do I set exposure time of Logitech C922 webcam on OpenCV?

Hello

I am writing a code for a project, and it requires some color segmentation which seems to be quite sensitive to the camera settings. I can get the frame size, brightness, autofocus, contrast and etc to set to a certain value, but I can't seem to set the exposure. My webcam always changes to auto exposure, and I prefer to have a set manual exposure. I tried the code below:

import cv2 import numpy as np cap = cv2.VideoCapture(1) cap.set(cv2.CAP_PROP_FRAME_WIDTH, 864) cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 480) cap.set(cv2.CAP_PROP_BRIGHTNESS, 0.7) cap.set(cv2.CAP_PROP_AUTOFOCUS,0) cap.set(cv2.CAP_PROP_EXPOSURE,0.5)

but as I stated before, it will not change the exposure. Does anyone have any experience with c922 webcams, or have any suggestions?

Thanks