5.1 点云表面平滑处理
介绍
Reconstruction
Surface smoothing
深度传感器不是很准确,并且生成的云具有测量误差,离群值,曲面中的孔等。可以通过算法对曲面进行重构,该算法遍历所有点并插值数据,试图猜测如何 原来的表面是。 像上采样一样,PCL使用MLS算法和类。 执行此步骤很重要,因为生成的云法线将更加准确。
代码详情
#include <pcl/io/pcd_io.h>
#include <pcl/surface/mls.h>
#include <pcl/visualization/cloud_viewer.h>
#include <pcl/filters/filter.h>
int
main(int argc, char** argv)
{
// Object for storing the point cloud.
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);
// The output will also contain the normals.
pcl::PointCloud<pcl::PointNormal>::Ptr smoothedCloud(new pcl::PointCloud<pcl::PointNormal>);
// Read a PCD file from disk.
if (pcl::io::loadPCDFile<pcl::PointXYZ>(argv[