ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Get a point cloud corresponding to given pixel indices

asked 2022-08-25 14:26:25 -0600

iHany gravatar image

updated 2022-08-25 14:32:56 -0600

Hi, I'm trying to publish a point cloud which corresponds to given pixel indices.

I'm using Realsense camera so will use similar terminology.

  1. I have certain indices of a color image, namely, Nx2 array indices where indices[i, :] = [i, j] for the pixel (i, j).
  2. I subscribe a depth image aligned to color image, namely, alinged_depth.
  3. I wanna get a point cloud (both PointCloud2 and PointCloud) which corresponds to the given indices, indices.

Is there any workaround for this?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2022-08-27 10:06:20 -0600

Mike Scheutzow gravatar image

You need the define the fields that your new PointCloud2 will have, create a list of objects (individual points) with corresponding values, then convert the raw data into a message. See this example:

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2022-08-25 14:26:25 -0600

Seen: 38 times

Last updated: Aug 27 '22