-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
D405 Setting Exposure in OpenCV #12185
Comments
Hi @DaveBGld Your FPS is lagging because of the '100000' exposure value that you have set. When setting a manual exposure value, certain value ranges can cause FPS to slow, as described by a RealSense team member at #1957 (comment) The default exposure value for the D405 is '33000'. The D405 does not have a separate RGB sensor and so shares its exposure setting with depth. So whatever the depth exposure is manually set to will affect RGB color exposure too. I confirmed in my own tests that FPS is 30 at exposure 33000 and drops to 6 at 100000 exposure. OpenCV has an exposure command called CAP_PROP_EXPOSURE for altering image brightness, though I note that you have already tried it. The links below have Python examples for implementing it. https://www.kurokesu.com/main/2020/05/22/uvc-camera-exposure-timing-in-opencv/ https://www.principiaprogramatica.com/2017/06/11/setting-manual-exposure-in-opencv/ opencv/opencv#9738 has advice from others whom CAP_PROP_EXPOSURE did not work for. According to their comments, CAP_PROP_AUTO_EXPOSURE should also be set to '0.25' in order for CAP_PROP_EXPOSURE to work. |
@MartyG-RealSense Thanks for the reply I tried this:
And also
before setting manual mode And also using values 3 and 1 for auto and manual exposure. Nothing works. The OpenCV forums point out that these values are back-end (Intel libreaalsense) dependent. People report different values for different cameras... |
The 'native' backend of librealsense is V4L2 by default (RSUSB = false). With the native backend, RealSense camera streams are accessible to standard non-RealSense Linux tools. |
@MartyG-RealSense thanks for that. Still the code you suggested
doesn't appear to have any effect on the camera feed. Any other ideas? Thanks, DBG |
What if you set VideoCapture as '0' instead of camera_index?
|
@MartyG-RealSense thanks, but I have two cameras connected |
I do not have any other suggestions to offer, unfortunately. I do apologize. |
So the D405 camera is not compatible with OpenCV... |
RealSense cameras are fully compatible with OpenCV. https://github.com/IntelRealSense/librealsense/tree/master/wrappers/opencv Typically, auto-exposure is used with RealSense OpenCV applications rather than manual exposure though. |
If it was fully compatible, my project would not be struggling and stuck on this. :( I guess the next step is getting some of the OpenCV OAK supported cameras... Thanks @MartyG-RealSense for the support above |
You are very welcome. I'm sincerely sorry that you did not get the outcome that you were aiming for. |
Using
cap.set(cv2.CAP_PROP_EXPOSURE, exposureValue)
no matter what exposure value (i.e. -4, 100000) does nothing.I have had to resort to this code:
But this code slows the fps to 6 instead of 30....
Specific question: What is the preferred way to set the exposure value in OpenCV Python?
Thanks!
DBG
The text was updated successfully, but these errors were encountered: