8 Replies Latest reply on Mar 23, 2017 6:07 AM by ABarks

    R200 Gain/Exposure

    ABarks

      Hi,

       

      I wonder if anyone can provide some more information about:

       

      1) The algorithm used for auto gain/exposure?

      Specifically, the meaning of:

           r200_auto_exposure_mean_intensity_set_point  (sounds obvious but the default value is 512 ???)

           r200_auto_exposure_bright_ratio_set_point      

           r200_auto_exposure_kp_gain                     

           r200_auto_exposure_kp_exposure             

           r200_auto_exposure_kp_dark_threshold

       

      2) The units of r200_lr_gain and r200_lr_exposure?

      The manual says that the min/max values are:

      gain: 1-63.9 [units?]

      exposure: 0.1-33.3 [units?]

      but the min/max values of r200_lr_gain and r200_lr_exposure are different, what is the mapping?

        • 1. Re: R200 Gain/Exposure
          MartyG

          Although I do not know the answer to these questions and could not find answers, I just wanted to point out for the benefit of others reading that these are Librealsense instructions.  Auto gain and auto exposure are currently not implemented in the official RealSense SDK.

          • 2. Re: R200 Gain/Exposure
            Intel Corporation
            This message was posted on behalf of Intel Corporation

            Hello ABarks,

            Thank you for interest in the Intel® RealSense™ Technology.

            I understand that you want to have a deeper understanding of the gain and exposure librealsense functions. 

            I don’t know if that information is available, but I’ll do some research. That means that I’ll be needing more time to come up with information that you may find useful.

            Thank you for your patience.

            Regards,
            Andres V.

            • 3. Re: R200 Gain/Exposure
              Intel Corporation
              This message was posted on behalf of Intel Corporation

              Hello ABanks,

              The information that has been made available regarding the settings that you are interested in, can be found here: https://github.com/IntelRealSense/librealsense/blob/master/include/librealsense/rs.hpp

              r200_auto_exposure_mean_intensity_set_point:
              Mean intensity set point. Requires the \c r200_lr_auto_exposure_enabled option to be set to 1

              r200_auto_exposure_bright_ratio_set_point:
              Bright ratio set point. Requires the \c r200_lr_auto_exposure_enabled option to be set to 1

              r200_auto_exposure_kp_gain:
              Kp gain. Requires the \c r200_lr_auto_exposure_enabled option to be set to 1

              r200_auto_exposure_kp_exposure:
              Kp exposure. Requires the \c r200_lr_auto_exposure_enabled option to be set to 1

              r200_auto_exposure_kp_dark_threshold:
              Kp dark threshold. Requires the \c r200_lr_auto_exposure_enabled option to be set to 1

              From what I searched, the meaning behind the previous settings is better understood studying topics related to photography.

              Regarding the units of exposure and gain, this is what I found in the librealsense source code in the file include/rs.hpp:
              -    The unit for exposure in the millisecond (ms)
              -    The unit for gain is the Decibel (dB)

              Please let me know if you find the previous information useful.

              If you need further assistance, don’t hesitate to contact us.

              Regards,
              Andres V.

              • 4. Re: R200 Gain/Exposure
                ABarks

                Hi Andres,

                 

                Thanks for the reply.

                 

                Re meanings of variables:

                 

                The information that has been made available regarding the settings that you are interested in, can be found here: https://github.com/IntelRealSense/librealsense/blob/master/include/librealsense/rs.hpp.

                r200_auto_exposure_mean_intensity_set_point:
                Mean intensity set point. Requires the \c r200_lr_auto_exposure_enabled option to be set to 1

                r200_auto_exposure_bright_ratio_set_point:
                Bright ratio set point. Requires the \c r200_lr_auto_exposure_enabled option to be set to 1

                r200_auto_exposure_kp_gain:
                Kp gain. Requires the \c r200_lr_auto_exposure_enabled option to be set to 1

                r200_auto_exposure_kp_exposure:
                Kp exposure. Requires the \c r200_lr_auto_exposure_enabled option to be set to 1

                r200_auto_exposure_kp_dark_threshold:
                Kp dark threshold. Requires the \c r200_lr_auto_exposure_enabled option to be set to 1

                I had seen this, however "r200_auto_exposure_bright_ratio_set_point = Bright ratio set point" is not particularly enlightening.  Can a more detailed explanation be provided?

                 

                Re units:

                Regarding the units of exposure and gain, this is what I found in the librealsense source code in the file include/rs.hpp:
                - The unit for exposure in the millisecond (ms)
                - The unit for gain is the Decibel (dB)

                I searched include/rs.hpp (librealsense/rs.hpp at master · IntelRealSense/librealsense · GitHub ) and can't find this, where are you looking?

                Units of ms/dB seem unlikely: the default values (in cpp-config-ui) are gain=400, exposure=164.  164ms gives a max frame rate of 6fps, but the actual framerate is clearly higher than this.

                • 5. Re: R200 Gain/Exposure
                  Intel Corporation
                  This message was posted on behalf of Intel Corporation

                  Hello ABarks,

                   

                  Unfortunately, it seems that the information provided is what is currently available from the librealsense team, but I’ll continue my research.

                   

                  Please keep in mind that, since the terminology associated with the librealsense is photography related, the answers you seek may be out of the scope of this technical support team.

                   

                  Regarding the gain and exposure units question, I’ll be needing more time to come up with information that you may find useful.

                   

                  Thank you for your patience.

                   

                  Regards,
                  Andres V.

                  • 6. Re: R200 Gain/Exposure
                    Intel Corporation
                    This message was posted on behalf of Intel Corporation

                    Hello  Abarks,

                    If you look at the include/rs.h file you will find this info:
                       RS_OPTION_R200_LR_AUTO_EXPOSURE_ENABLED                   = 28, /**< {0, 1} */
                        RS_OPTION_R200_LR_GAIN                                    = 29, /**< 100 - 1600 (Units of 0.01) */
                        RS_OPTION_R200_LR_EXPOSURE                                = 30, /**< > 0 (Units of 0.1 ms) */

                        RS_OPTION_R200_EMITTER_ENABLED                            = 31, /**< {0, 1} */
                        RS_OPTION_R200_DEPTH_UNITS                                = 32, /**< micrometers per increment in integer depth values, 1000 is default (mm scale) */
                        RS_OPTION_R200_DEPTH_CLAMP_MIN                            = 33, /**< {0 - USHORT_MAX}. Can only be set before streaming starts. */
                        RS_OPTION_R200_DEPTH_CLAMP_MAX                            = 34, /**< {0 - USHORT_MAX}. Can only be set before streaming starts. */
                        RS_OPTION_R200_DISPARITY_MULTIPLIER                       = 35, /**< {0 - 1000}. The increments in integer disparity values corresponding to one pixel of disparity. Can only be set before streaming starts. */
                        RS_OPTION_R200_DISPARITY_SHIFT                            = 36, /**< {0 - 512}. Can only be set before streaming starts. */

                    Also, you can find some information on the R200 settings in the R200 Datasheet section 5.3. We have engaged the RealSense camera team on the other settings that are not addressed in the datasheet.

                    Regards,
                    Jesus 
                    Intel Customer Support

                    • 7. Re: R200 Gain/Exposure
                      Intel Corporation
                      This message was posted on behalf of Intel Corporation

                      Hello ABarks,

                      The algorithms and supported settings are camera firmware dependent. On the RealSense R200 camera with FW 1.0.72.0, there is a new auto-exposure algorithm.

                      The new algorithm simplifies the user interface in that several parameters are not used (they should be set to 0 or left at default because, for the R200 camera, they are still range-checked).  

                      These parameters are:
                      r200_auto_exposure_bright_ratio_set_point      
                      r200_auto_exposure_kp_gain                     
                      r200_auto_exposure_kp_exposure             
                      r200_auto_exposure_kp_dark_threshold

                      The r200_auto_exposure_mean_intensity_set_point is still applicable.  

                      The mean intensity set point tells the auto-exposure algorithm how high to adjust.  Increasing the set point results in a brighter image while lowering it results in a darker image.  This allows the user to set an expected average intensity across the region of interest that the auto-exposure algorithm attempts to maintain.

                      I hope you find the previous information useful.

                      Regards,
                      Andres V.

                      • 8. Re: R200 Gain/Exposure
                        ABarks

                        OK, thanks Andres.

                        Something still doesn't seem right, since the default value for r200_auto_exposure_mean_intensity_set_point is 512 (for intensity values in [0,255])?

                        But I'm giving up on auto-exposure anyway because it becomes unstable under some conditions (flicking between all-black and all-white) so I think I have to do it myself anyway.