合并点云分为两种类型:第一种是两个点云数据集的字段类型和维度相同,合并之后点云只是点的数量增加了;第二种是两个点云数据集的字段类型或维度不同,但是点的数量相同,合并之后相当于扩展了字段或维度,例如点云A是N个点的XYZ点集,点云B是N个点的RGB点,则连接两个字段形成的点云C是N个XYZRGB类型。
一、扩展点的数目
相关函数:
inline const PointCloud
operator + (const PointCloud& rhs)
example:
cloudC = cloudA + cloudB;
二、扩展点云字段或者维度
相关函数:
template <typename PointIn1T, typename PointIn2T, typename PointOutT> void
pcl::concatenateFields (const pcl::PointCloud<PointIn1T> &cloud1_in,
const pcl::PointCloud<PointIn2T> &cloud2_in,
pcl::PointCloud<PointOutT> &cloud_out)
example:
一定要确定cloud1_in和cloud2_in点云数目相同,并且cloud_out的字段包含两个输入点云的所有字段!
// 一个PointXYZ类型的点云和一个Normal类型的点云合并为一个PointNormal类型点云
pcl::concatenateFields(cloudC, cloud_normal, cloud_xyznormal);