You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am trying to convert the pixels of segmentation result (some area of an image) to camera coordinate and then to a 2d grid map, I have been trying to use the function rs2_deproject_pixel_to_point to do this, but it is too slow because there are so many pixels to process.
Later I found out about the opencv_pointcloud_viewer.py
points = pc.calculate(depth_frame)
pc.map_to(mapped_frame)
# Pointcloud data to arrays
v, t = points.get_vertices(), points.get_texture_coordinates()
verts = np.asanyarray(v).view(np.float32).reshape(-1, 3) # xyz
which convert the depth_frame to pointcloud data, in it the verts data in it looks like what I needed but I am not sure.
Or is there a better way to do it?
Thanks.
The text was updated successfully, but these errors were encountered:
Hi @ysj2009 They are not the same but have a similar result.
Using pc.map_to and pc.calculate instead of rs2_deproject_pixel_to_point provides more accurate results if depth to color alignment is being used. In practice though, the difference in accuracy between the two methods is small. If pc.calculate works well for you then I would certainly recommend continuing to use it.
The only better method than pc.calculate in terms of performance speed would be rs2_project_color_pixel_to_depth_pixel, which provides a depth value for a single coordinate by converting an RGB color pixel into a depth pixel, so that you do not need to burden the computer with processing by depth-color aligning the entire image.
Hi, I am trying to convert the pixels of segmentation result (some area of an image) to camera coordinate and then to a 2d grid map, I have been trying to use the function rs2_deproject_pixel_to_point to do this, but it is too slow because there are so many pixels to process.
Later I found out about the opencv_pointcloud_viewer.py
which convert the depth_frame to pointcloud data, in it the verts data in it looks like what I needed but I am not sure.
Or is there a better way to do it?
Thanks.
The text was updated successfully, but these errors were encountered: