0

I am new to PCL and I am sorry if it is a trivial question.

I was wondering if there is a "simple" way to do this:

I have a costume "point cloud" of 3dPoints (X, Y, Z). I have each 3dPoint's pixel index as demonstrated below:

          (0) +----------------------------+ (101)
        (102) |                            | (203)
              |                            |
              |                            |
              |                            |
              +----------------------------+ (611)

I would like to make a loop over all the points of the costume point cloud, do something to them, and fill the pcl::PointCloud<pcl::PointXYZ> pointcloud (initialized before the loop) with the same pixel index.

pcl::PointCloud<pcl::PointXYZ>::Ptr pcl_cloud(new pcl::PointCloud<pcl::PointXYZ>);
for (all 3dPoints of the costume point cloud)
{
     // do somethin to them
     // fill the pcl_cloud with the 3dPoint 's X, Y,and Z with the same pixel index
}

Thanks for your help

HSA
  • 13
  • 4

1 Answers1

0
for (auto point : costume) {
    pcl_cloud->push_back(pcl::PointXYZ(point.x, point.y, point.z));
}

Reference: https://pointclouds.org/documentation/singletonpcl_1_1_point_cloud.html#a0b4d7abee110e47d90635eb042488bb4