学习PCL心得体会——结构点云(Organized PointClouds)

有在学习PCL的朋友们,或多或少会接触到结构点云(Organized PointClouds)。

结构点云的定义

什么是结构点云?下面引用PCL官网的一段解释。

1 结构点云:An organized point cloud dataset is the name given to point clouds that resemble

an organized image (or matrix) like structure, where the data is split into rows and columns.

也就是说,像平常的照片一样,有行列顺序的点云,叫结构点云。

例如:

cloud.width = 640; // Image-like organized structure, with 640 rows and 480 columns,

cloud.height = 480; // thus 640*480=307200 points total in the dataset

相反,结构点云以外的点云,就叫无结构点云。

例如:

cloud.width = 307200;

cloud.height = 1; // unorganized point cloud dataset with 307200 points

结构点云的重要性

由Kinect等支持OpenNI接口的相机获取的点云为结构点云,但是结构点云经过某些人为操作后,会变为无结构点云,比如滤波操作等。

而PCL算法库里面的某些重要算法,仅支持结构点云,比如多平米分割算法(OrganizedMultiPlaneSegmentation)。

想必有不少朋友遇到过这样的问题:

[pcl::IntegralImageNormalEstimation::setInputCloud] Input dataset is not organized (height=1).

下面,我们以直通滤波为例,解释如何让结构点云经过操作之后,仍为结构点云。闲话不多说,直接上代码:

pcl::PassThrough<pcl::PointXYZ> pass;
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud1(new pcl::PointCloud<pcl::PointXYZ>);
pass.setInputCloud(cloud);
pass.setFilterFieldName("z");
pass.setFilterLimits(0.4, 0.94);
pass.setKeepOrganized(true);
pass.filter(*cloud1);

我们只需要在进行滤波的时候,将点云设置为KeepOrganized即可,也就是pass.setKeepOrganized(true);这条语句。

下面附上一幅OrganizedMultiPlaneSegmentation的效果图,祝大家学习愉快!

 

posted @ 2017-02-16 11:01  WilliamChan  阅读(7425)  评论(6编辑  收藏  举报