3 Replies Latest reply on Apr 19, 2018 9:28 AM by Taliesin

    How to properly calculate intrinsics for the depth frame?

    Taliesin

      I'm writing a custom system and would very much like to call the functions rs2_project_point_to_pixel() and rs2_deproject_pixel_to_point() in order to do things like creating my own point cloud (or at least, I plan to copy/paste and adapt these into my own apps).

       

      To do this, I need to pass in a pointer to an rs2_intrinsics object.

       

      All well and good ...  Looking at https://github.com/IntelRealSense/librealsense/wiki/API-How-To#get-video-stream-intrinsics , it appears that I can use the quoted code in the "Get Field of View" section:

       

      rs2::pipeline pipe;
      rs2::pipeline_profile selection = pipe.start();
      auto depth_stream = selection.get_stream(RS2_STREAM_DEPTH)
                                   .as<rs2::video_stream_profile>();
      auto i = depth_stream.get_intrinsics();
      
      

       

      Looking in the variable 'i' in the debugger, it appears to be ALMOST correct ...  everything is filled in with what appear to be correct values EXCEPT for the distortion coefficients (rs2_intrinsics::coeffs) which are all 0 -- and that can't possibly be correct?

       

      I will actually need those values to be filled in properly to call those functions I mentioned.

       

      So -- how to fill in the distortion coefficients?