View my account

The 3D point results of deproject are different from those of pointcloud.calculate

Comments

9 comments

  • MartyG

    In general, when calculating a 3D point cloud that aligns depth and color, the extrinsics of the camera should be taken into account in order to help avoid error.  

    I hope that the discussion in the link below will be useful to you.

    https://github.com/IntelRealSense/librealsense/issues/2948

    In that case, the approach that worked in the end for the user in that discussion was to use the instruction rs2_project_color_pixel_to_depth_pixel

    0
    Comment actions Permalink
  • 1106569356

    So that means that I can use this function to get the depth  image pixels corresponding to the color image pixels, right?And then we use deproject to get 3d coordinates?

    0
    Comment actions Permalink
  • MartyG

    Another user used rs2_project_color_pixel_to_depth_pixel to project the color pixel to the depth pixel and then found the value of the depth pixel after that and finally deprojected the depth pixel to a 3D point.  They posted their script code for doing this.

    https://github.com/IntelRealSense/librealsense/issues/2982

    0
    Comment actions Permalink
  • 1106569356

    I am using ubuntu now,Can I use this function to get depth pixel?

    0
    Comment actions Permalink
  • 1106569356

    Do I need to do this even if I've already aligned the depth and color?

    0
    Comment actions Permalink
  • MartyG

    With Librealsense, the OS that you are using does not matter so much as the programming language that you are writing your code in.  So if you are using the C++ language for example then you should be able to use the code in that link without much trouble.  If you are using another language such as C# or Python then some conversion may be necessary for those languages.

    0
    Comment actions Permalink
  • MartyG

    Do I need to do this even if I've already aligned the depth and color?

    Deprojection is useful if you are trying to convert 2D data such as an image into a 3D point cloud.  There are easier ways to generate a textured point cloud though, if that is your goal.  The SDK has an example pointcloud program in the C++ language for this.

    https://github.com/IntelRealSense/librealsense/tree/master/examples/pointcloud

    0
    Comment actions Permalink
  • 1106569356

    Maybe I didn't make it clear.I've already done the alignment and made the depth export_to_ply a point cloud, but now I need to get points in the point cloud that correspond to positions in the color image, so I use deproject_to...I don't know if this is true.

    0
    Comment actions Permalink
  • MartyG

    This question unfortunately goes beyond my RealSense programming knowledge.  It may be worth asking it at the RealSense GitHub site if you want to use scripting to get the coordinates using Librealsense code without going outside of Librealsense to do it.  You can post a question there by visiting the link below and clicking the New Issue button.

    https://github.com/IntelRealSense/librealsense/issues

    There are other means with external programs to analyze the contents of a .ply file.  These include:

    MeshLab

    https://www.andreasjakl.com/capturing-3d-point-cloud-intel-realsense-converting-mesh-meshlab/

    pyntcloud (in the Python language)

    https://pypi.org/project/pyntcloud/

    0
    Comment actions Permalink

Please sign in to leave a comment.