View my account

Intel RealSense D415 get intrinsic parameters using the API (pyrealsense2)



  • MartyG

    Hi Oriol Vila  You are correct that the camera intrinsics can be retrieved in Python with the get_intrinsics() instruction.


    On the majority of RealSense 400 Series camera models all coefficients are deliberately set to zero (except for RGB on the D455 model, which is non-zero).  The reason for this is provided at the link below.


    The Y16 infrared format does not have retrievable intrinsics.  It is unrectified because it is used for camera calibration.


    You can list all available intrinsic and extrinsic parameters for a camera using the RealSense SDK's 'rs-enumerate-devices' tool by inputting the command below to launch the tool in calibration in calibration information mode.

    rs-enumerate-devices -c


    The parameters listed by rs-enumerate-devices will be the values currently listed in the camera's calibration table, which means that they will not be the original factory-new parameters if the camera has been re-calibrated since purchase.  If you need the original factory calibration then you can reset the camera to them in the RealSense Viewer tool using the instructions at the link below.

    Comment actions Permalink
  • Oriol Vila

    As you said, the coefficients are set to zero for the stereo matching. Therefore when I get the intrinsic parameters of the rectified infrared stream they are all zero.

    The problem is that I want to do camera calibration and I'm working with the Y16 format. In this case, the distortion coefficients are required for generating the XML calibration file. And by default, they have a factory value which I want to know.

    After connecting an Intel camera I can reset the gold factory calibration settings with 

    Intel.Realsense.CustomRW -g

    And If I then read the calibration parameters using 

    Intel.Realsense.CustomRW -r

    And then I get the non-zero distortion coefficients I need in order to do a better recalibration.

    Is there a way I can read all these parameters using the pyrealsense2/realsense API without having to execute the external Intel.Realsense.CustomRW.exe application?

    Why is it not possible to retrieve the Y16 infrared format intrinsics using the .get_intrinsics() function?

    So far I have been able to calibrate D415 devices only using pyrealsense2 and OpenCV, but I would like to read the default calibrations parameters including the distortion coefficients from the Y16 format.

    rs-enumerate-devices -c does not return me with the Y16 intrinsic coefficients that I need.

    I hope this time I have explained myself better.


    Comment actions Permalink
  • MartyG

    If the coefficients are retrieved through SDK instructions instead of with the external CustomRW tool then they will be the zeroed version of the values rather than the raw originals.

    In a old case at the link below, a RealSense user identified the intrinsics for the Y16 stream using CustomRW by looking at the intrinsics for 1280x800 resolution.


    As a RealSense team member in the above-linked discussion confirms, intrinsics for Y16 cannot be listed using sensor querying tools created with RealSense SDK programming language instructions, such as rs-sensor-control, because the SDK's API does not have a mechanism for doing so.

    Comment actions Permalink
  • Oriol Vila

    I see, seems that the CustomRW tool is the only way to do so.

    It would be helpful that in future versions of the SDK, the Y16 parameters could be retrieved as they are stored somewhere in the device.

    Thanks for the information!

    Comment actions Permalink

Please sign in to leave a comment.