Make D415 left and right infrared image brighter.
Hi,
I have a feature detection algorithm, which works well on the left and right infrared images of D435i. However, as I change the camera to D415, the algorithm failed because the left and right infrared images look very dark compared with D435i. I want to make the infrared image brighter. I play with the parameters of exposure time and gain in the RealSense Viewer and found both parameters can make the image brighter.
1. Which parameter should I use in order to increasing the contrast and also making the image brighter?
2. If I set the gain or the exposure time via the API, does this mean the auto exposure will be disabled automatically?
3. Should I use depth_sensor.set_option(RS2_OPTION_DIGITAL_GAIN, value) to change the gain?
Thanks.
Yixun
-
Hi Yxliuwm The infrared image will brighten if the Laser Power setting's value is increased from its default value of '150' to its maximum value of '360'. Python code for setting Laser Power can be found at the link below.
https://github.com/IntelRealSense/librealsense/issues/1258#issuecomment-374112555
The infrared option can also be brightened by increasing gain, though as you mention, setting a manual exposure or gain value automatically disables auto-exposure. So if you wish to keep auto-exposure enabled, increasing Laser Power may be the most appropriate action.
RS2_OPTION_DIGITAL_GAIN does not control gain on 400 Series cameras. It is a setting on the L515 camera model. Use RS.OPTION.GAIN instead. There is not an example script for doing so, though you should be able to set gain if you use the Python code for exposure - sensor.set_option(rs.option.exposure - at the link below and change 'exposure' to 'gain'.
https://github.com/IntelRealSense/librealsense/issues/4449#issuecomment-514226669
You can use RS.OPTION.CONTRAST to set the contrast, though as contrast is an RGB option rather than a depth option you should access the RGB sensor instead of the depth sensor. you can do this by setting a sensor index number of '1' (as '0' is the depth sensor) using the query_sensors() instruction, like in the Python script here:
https://github.com/IntelRealSense/librealsense/issues/10143#issuecomment-1013340798
But as Contrast is an RGB option, changing it will have no effect on the Infrared brightness.
-
Both depth / infrared and RGB have a gain option. By default RS2_OPTION_GAIN will affect depth / infrared. To change RGB gain, the program has to be told specifically to access the RGB sensor.
When gain is increased above its default value of '16', it makes the depth image noisier and increases the brightness of the infrared image.
-
Yes, the Mean Intensity Setpoint is an Advanced Mode setting. Code for defining the setpoint can be found at the link below.
Support for Advanced Mode is not something that you need to build. It is enabled by default in RealSense 400 Series cameras.
Please sign in to leave a comment.
Comments
5 comments