Is there any range of values for the exposure flag?
What is the unit of exposure value? seconds? . Also, is there any range of value?
What is the unit of exposure value? seconds? . Also, is there any range of value?
the enum should be CAP_PROP_EXPOSURE
but isn't work with many API/cameras.
The VideoCapture
base class is implemented with different VideoInput classes for different APIs like CAP_DSHOW, CAP_VFW, CAP_MSMF
.... Each API might support or not any properties.
The CAP_PROP_EXPOSURE isn't generally supported. You can check OpenCV yourself looking at the setProperty
method for any API implementation here (Check the files cap_*.cpp). For example
In addiction the API itself is interfacing with the cam drivers that should respect standards but most often wont.
This means that for example some cameras accepts values for exposure but as a step of pre-defined range like from 1..10 that is not time. Using DSHOW the accepted range is available only internally here or here but you have to use the Debug breakpoints to read.
Conclusion: if you need to control the exposure use driver library of you vision system as suggested by @LBerger
@pklab@Sarala Actually, V4L supports CAP_PROP_EXPOSURE. You just have to change the CAP_PROP_AUTO_EXPOSURE setting (which is toggled on "auto" mode by default on many cases) to switch it from "auto" to "manual" :
capture.set(cv::CAP_PROP_AUTO_EXPOSURE, 0.25) // where 0.25 means "manual exposure, manual iris"
Then, you will be able to set CAP_PROP_EXPOSURE correctly.
The CAP_PROP_EXPOSURE setting won't work if you downloaded OpenCV directly from their download page, because their official build lasts from decembrer 2015. The V4L exposure setting has been corrected on april 18th 2016 and thus hasn't been included in the build from the official download page.
@Major Squirrel thank you for your tips. Also CAP_DSHOW suffers same issue because current implementation doesn't consider the auto/manual mode.
In general videoio
is a complex module based on vary videoInput libraries from different sources. Sincerely it should be used with care because result could be different on different platform and/or cameras.
Asked: 2016-06-10 09:16:25 -0600
Seen: 12,877 times
Last updated: Jun 16 '16
Getting single frames from video with python
After setting capture property, reading the property returns 0.0
Video Capture not working in OpenCV 2.4.2 Windows7 32bit vs9
How to set camera resolution in OpenCV on Android?
CaptureFromFile - what does OpenCV exactly do? [closed]
cv2.VideoCapture: Cannot read from file
How to set resolution of video capture in python with Logitech c910 & c920
there is no unit for exposure flag in videocapture.
So, if i want my exposure time to be 15 sec, then how to do that?
use driver library of you vision system
Hello, Due to some reasons i had to install anaconda python with opencv. And now it says "module has no attribute "cv2.CV_CAP_PROP_EXPOSURE". I want to change the exposure time of my camera what to do?