[D455] Generate PointCloud
Hi,
1. I read two ways to get pointcloud from D455.
+) pointcloud.calculate(depthFrame) -> pointcloud.map_to(colorFrame)
+) pointcloud.map_to(colorFrame) ->pointcloud.calculate(depthFrame)
Are they different? Do you have documents or examples about it?
2. After that, I use numpy.asanyarray(pointcloud.get_vertices(2)). I get an array with a shape is (921600,3). I understand 921600 = 720*1280.(Image Resolution).
But when I export to .ply file and read again by open3D library. I get about 100K or 400k points.
Why are they different?
Thanks
-
Hi Nguyenduyduc14. These two instructions are part of the same method for generating a point cloud. First map_to is used, followed by pc.calculate. For example:
pc.map_to(color_frame) // Tell pointcloud object to map to this color frame
points = pc.calculate(depth_frame) // Generate the pointcloud and texture mappings
This pointcloud generation method is more accurate than aligning and then using rs2_deproject_pixel_to_point and you can obtain the XYZ coordinates of the points from the pc.calculate pointcloud's vertices like in the Python pointcloud script at the link below.
https://github.com/IntelRealSense/librealsense/issues/4612#issuecomment-566864616
In regard to the difference in the number of points, information about this is provided at your other question at the link below.
https://support.intelrealsense.com/hc/en-us/community/posts/8469810288275
-
Typically the map_to method of generating a pointcloud would not be used with depth-color alignment because map_to is already aligning (or mapping) depth to color, or color to depth depending on whether color or depth is in the pc.map_to brackets.
The map_to + pc.calculate method should be more accurate than using alignment, as the align process can introduce some inaccuracy into the coordinates. It isn't a large amount of difference though in regard to the accuracy of the two methods of generating a pointcloud (map_to or alignment and then deprojection).
Please sign in to leave a comment.
Comments
3 comments