The 3D point results of deproject are different from those of pointcloud.calculate
I calculated the pointcloud through the pointcloud function, but I needed to calculate the 3d coordinates corresponding to some color points. The results obtained by deproject were different. Is there any way to obtain the accurate point?
-
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
-
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.
-
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.
-
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
-
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)
Please sign in to leave a comment.
Comments
9 comments