View my account

Vector based implementation of "rs2_deproject_pixel_to_point" function

Comments

4 comments

  • MartyG

    Hi Dhruvdarda2001  Instead of looping through each pixel to get an XYZ coordinate, it will use less processing power if you target one specific pixel with the rs2_project_color_pixel_to_depth_pixel instruction which converts a 2D color pixel to a 3D depth pixel.  Using this method, it is not necessary to process the entire image.  The link below demonstrates use of this instruction in Python.

    https://github.com/IntelRealSense/librealsense/issues/5603#issuecomment-574019008

     

    Official documentation about this instruction can be found here:

    https://intelrealsense.github.io/librealsense/doxygen/rsutil_8h.html#af04b7b1ba50b1d9e03089d1e5186d2f8

    0
    Comment actions Permalink
  • Dhruvdarda2001

    Thanks MartyG, that is insightful!

    So, is there a function that can do exactly opposite of what "rs2_project_color_pixel_to_depth_pixel" is doing, as in, is there any pre-built function that can give me the (pixel_x, pixel_y) from an approximate (real_world_x, real_world_y) that I can get from other sources?

    0
    Comment actions Permalink
  • MartyG

    There is not an opposite function for rs2_project_color_pixel_to_depth_pixel.  Typically, if you wish to go from 2D to 3D and back again then you would perform rs2_deproject_pixel_to_point to go from 2D to 3D and then perform rs2_project_point_to_pixel to go back from 3D to 2D.

     

     

    0
    Comment actions Permalink
  • Dhruvdarda2001

    Thanks MartyG! This is helpful.

    0
    Comment actions Permalink

Please sign in to leave a comment.