graspnet/graspnet-baseline

A question about function `create_point_cloud_from_depth_image`

elenacliu opened this issue · 1 comments

assert(depth.shape[0] == camera.height and depth.shape[1] == camera.width)
xmap = np.arange(camera.width)
ymap = np.arange(camera.height)
xmap, ymap = np.meshgrid(xmap, ymap)
points_z = depth / camera.scale
points_x = (xmap - camera.cx) * points_z / camera.fx
points_y = (ymap - camera.cy) * points_z / camera.fy
cloud = np.stack([points_x, points_y, points_z], axis=-1)
if not organized:
cloud = cloud.reshape([-1, 3])
return cloud

In L38~L39, to get points' x, y coordinates in the camera space, why do you multiply points_z?

This is a basic transformation in point cloud computation. You can refer to related materials.