【问题标题】:Initializing (and fill) a pcl::PointCloud<pcl::PointXYZ> with each points index in an image使用图像中的每个点索引初始化(并填充) pcl::PointCloud<pcl::PointXYZ>
【发布时间】:2021-12-30 02:15:35
【问题描述】:

我是 PCL 的新手,如果这是一个小问题,我很抱歉。

我想知道是否有一种“简单”的方法可以做到这一点:

我有一个 3dPoints (X, Y, Z) 的服装“点云”。我有每个 3dPoint 的像素索引,如下所示:

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

我想对服装点云的所有点进行循环,对它们做点什么,并用相同的像素索引填充pcl::PointCloud&lt;pcl::PointXYZ&gt; pointcloud(在循环之前初始化)。

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
}

感谢您的帮助

【问题讨论】:

    标签: c++11 c++14 point-cloud-library point-clouds pcl


    【解决方案1】:
    for (auto point : costume) {
        pcl_cloud->push_back(pcl::PointXYZ(point.x, point.y, point.z));
    }
    

    参考:https://pointclouds.org/documentation/singletonpcl_1_1_point_cloud.html#a0b4d7abee110e47d90635eb042488bb4

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-26
      • 2021-03-12
      • 2020-07-31
      • 2017-12-08
      相关资源
      最近更新 更多