I am using Windows 7 64 bit operation system together with Python 3 and OpenCV. My computer is interfaced to two Logitech webcam of the following model:
1) Logitech HD Webcam C615 2) Logitech QuickCam Pro 9000
In Python I am running the below script
import cv2
cap1 = cv2.VideoCapture()
cap2 = cv2.VideoCapture()
cap1.set(cv2.CAP_PROP_AUTOFOCUS,0) # I want to change the focus manually myself
cap1.set(cv2.CAP_PROP_FOCUS,10)
cap2.set(cv2.CAP_PROP_FOCUS,10)
cap1.set(cv2.CAP_PROP_EXPOSURE,25)
cap2.set(cv2.CAP_PROP_EXPOSURE,25)
#get frame
ret, frame1 = cap1.read()
ret, frame2 = cap2.read()
#display result
cv2.imshow('cam 1',frame1)
cv2.imshow('cam 2',frame2)
The problem is, regardless on how I change the parameters in my cv2.set, I don't see the change being reflected in the captured image.
I then went to download Logitech's driver for the camera called Logitech Webcam Software. Using their software I can make the appropriate settings in both of the cameras. When closing the software, and restart python and running the script, the captured images appear exactly according to the settings that I have set in the Logitech Webcam Software.
My questions are:
1) Why can I not set the camera settings directly using Python and OpenCV?
2) How should I change my script in order to interface the camera settings direct from Python?
Thanks!