-
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
Change the RGB camera's exposure from inside the code #3224
Comments
Before you set exposure manually, you should first turn off auto-exposure in your code. Auto-exposure could be turned off with this instruction: sensor.set_option(rs2_option::RS2_OPTION_ENABLE_AUTO_EXPOSURE, 0); The link below may be of use to you in developing scripting that utilizes RS2_OPTION_EXPOSURE. |
yes i already turned the automatic exposure Off. to get the rgb_sensor instead of the depth_sensor ? Thanks |
I believe that RS2_OPTION_EXPOSURE is the correct instruction, but there can be some variation on the initial sensor.set sensor setup definition. For example, one user used the following code to set the RGB sensor exposure: color_sensor.set_option(RS2_OPTION_EXPOSURE, 100); |
How did he get defined the color_sensor variable ? I was experimenting with the realsense Viewer and i found the following strange behavior: Thanks |
Apologies for not quoting the source. It is in the middle of a long script in the opening message of the discussion below: In regard to your other questions about different exposure effects: one of the Intel developer staff on this forum will be able to give a better answer than I can. |
Thanks to MartyG-RealSense for all the information. Hi HamdiBouchech, Thanks! |
Hi HamdiBouchech, Any updates on this? If nothing else is needed, this one will be closed soon. Thanks! |
|---------------------------------|------------------------------------------- |
| Camera Model | { D400 } |
| Firmware Version | (05.09.14.00) |
| Operating System & Version | {Win (10) | |
| Platform | PC |
| SDK Version | { 2.14.1 } |
| Language | {C++} |
| Segment | {others } |
Hi,
I was trying to change the exposure time of the RGB camera (D415 realsense) from inside my code, but i couldnt figure out how to do that.
I could find how to do that for the IR camera using this function:
profile.get_device().firstrs2::depth_sensor().set_option(RS2_OPTION_EXPOSURE, (float)(exposureMicroSec));
But i couldn't find the equivalent for the RGB camera ?
I tried doing:
std::string sensorName = sensor.get_info(RS2_CAMERA_INFO_NAME);
if (sensorName.compare("RGB Camera") == 0) {
sensor.set_option(RS2_OPTION_EXPOSURE, 5000.f);
which changes the RGB exposure inside the Viewer but inside the code that had no effect on the RGB colors, they are still coming dark.
Could you please tell me how to adjust the exposure time of the RGB camera within a c++ code ?
Thanks
The text was updated successfully, but these errors were encountered: