Robotics StackExchange | Archived questions

Get a point cloud corresponding to given pixel indices

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?

Asked by iHany on 2022-08-25 14:26:25 UTC

Comments

Answers

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:

https://gist.github.com/lucasw/ea04dcd65bc944daea07612314d114bb

Asked by Mike Scheutzow on 2022-08-27 10:06:20 UTC

Comments