I'm trying to figure out how to manually set the exposure for my Facetime HD camera in opencv , which I write in Python. I am using opencv version 3.2.0, python 2.7 and it works on OSX El Capitan.
I am writing a program that will shoot from a webcam every n seconds and write it to disk. From what I saw in the documentation, I would like to use this method to set the exposure on my camera.
cv2.VideoCapture.set(CV_CAP_PROP_EXPOSURE, value) β retval
After some twisting and searching on the Internet, I found that I was able to access this camera property in my version of opencv using the following:
cv2.CAP_PROP_EXPOSURE
What is strange is that in my function that actually captures the photo, I see that the default exposure value is 0.0, and then when I go to change it using the set method, the exposure did not change when I again check the value. It seems that the set method just doesn't work.
Here is my function:
def takePhoto(): cam = cv2.VideoCapture(0) print(cam.get(cv2.CAP_PROP_EXPOSURE))
Is it possible that this camera is not compatible with manual exposure control? I also read in one or two places that opencv on OSX does not allow you to manually control camera properties. Is that what's wrong here? Or am I using the set method incorrectly? I just need to be able to manually control the exposure, since the photos taken by my program are constantly underexposed.
Thanks Brian
Brian bartz
source share