Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set auto-exposure mode ? #52

Open
salocinx opened this issue Nov 29, 2018 · 0 comments
Open

How to set auto-exposure mode ? #52

salocinx opened this issue Nov 29, 2018 · 0 comments

Comments

@salocinx
Copy link

I am working with OpenCV 3.4.2 and Visual Studio 2015 / C++ on Windows 10.

I can set the exposure of the camera to any value by using this code:

cv::VideoCapture *cap;  
...
cap = new cv::VideoCapture(0);
cap->set(CV_CAP_PROP_EXPOSURE, exposure);   // exposure = [0, 255]

Now I would like to switch to auto-exposure too. How can I set the camera to auto-exposure mode?

I tried the following:

cap->set(CV_CAP_PROP_EXPOSURE, 0);       // not working
cap->set(CV_CAP_PROP_EXPOSURE, -1);      // not working
cap->set(CV_CAP_PROP_AUTO_EXPOSURE, 1);  // not working, exposure stays fixed
cap->set(CV_CAP_PROP_AUTO_EXPOSURE, 0);  // not working, exposure stays fixed
cap->set(CV_CAP_PROP_AUTO_EXPOSURE, -1); // not working, exposure stays fixed

Any idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant