首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用图像中的每个点索引初始化(并填充)一个pcl::PointCloud<pcl::PointXYZ>

用图像中的每个点索引初始化(并填充)一个pcl::PointCloud<pcl::PointXYZ>
EN

Stack Overflow用户
提问于 2021-11-19 09:27:22
回答 1查看 1K关注 0票数 0

我对PCL并不熟悉,如果这是一个微不足道的问题,我很抱歉。

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

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

代码语言:javascript
复制
          (0) +----------------------------+ (101)
        (102) |                            | (203)
              |                            |
              |                            |
              |                            |
              +----------------------------+ (611)

我想在服装点云的所有点上做一个循环,对它们做些什么,并用相同的像素索引填充pcl::PointCloud<pcl::PointXYZ> pointcloud (在循环之前初始化)。

代码语言:javascript
复制
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
}

谢谢你的帮忙

EN

回答 1

Stack Overflow用户

发布于 2022-01-06 20:09:32

代码语言:javascript
复制
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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70032574

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档