Items with no label
3335 Discussions

How to control the exposure and gain by programming in C++?

zchen38
Beginner
2,722 Views

Can someone tell me How to control the exposure and gain and switch of infrared projector by programming in C++ on D435?

Thanks a lot.

0 Kudos
4 Replies
MartyG
Honored Contributor III
1,280 Views

The command for gain control is:

gain_control

https://unanancyowen.github.io/librealsense2_apireference/structlibrealsense_1_1gain__control.html# a81150897487b7dc3b980c17338b193f5 Intel® RealSense™ Cross Platform API: librealsense::gain_control Struct Reference

A list of commands related to exposure can be found in the index below, starting at 'exposure' downwards.

https://unanancyowen.github.io/librealsense2_apireference/functions_e.html Intel® RealSense™ Cross Platform API: Class Members

The laser power and emitter enabling / disabling can be controlled with a script at the very bottom of the page below:

https://github.com/IntelRealSense/librealsense/wiki/API-How-To API How To · IntelRealSense/librealsense Wiki · GitHub

0 Kudos
zchen38
Beginner
1,280 Views

Thank you for your answer. For gain and exposure, can you give an example for detail?

0 Kudos
MartyG
Honored Contributor III
1,280 Views

Lines 203 to 315 of the code for the camera's Advanced Mode show code for controlling the laser, gain and exposure modes.

https://github.com/IntelRealSense/librealsense/blob/9437bc24c0f4ce16193f1045ceea703a8151b96d/src/ds5/advanced_mode/advanced_mode.cpp# L203 librealsense/advanced_mode.cpp at 9437bc24c0f4ce16193f1045ceea703a8151b96d · IntelRealSense/librealsense · GitHub

0 Kudos
Reply