#include #include #include #include int main () { // Load input file into a PointCloud with an appropriate type pcl::PointCloud::Ptr cloud (new pcl::PointCloud ()); // Load bun0.pcd -- should be available with the PCL archive in test pcl::io::loadPCDFile ("bun0.pcd", *cloud); // Create a KD-Tree pcl::search::KdTree::Ptr tree (new pcl::search::KdTree); // Output has the PointNormal type in order to store the normals calculated by MLS pcl::PointCloud mls_points; // Init object (second point type is for the normals, even if unused) pcl::MovingLeastSquares mls; mls.setComputeNormals (true); // Set parameters mls.setInputCloud (cloud); mls.setPolynomialOrder (2); mls.setSearchMethod (tree); mls.setSearchRadius (0.03); // Reconstruct mls.process (mls_points); // Save output pcl::io::savePCDFile ("bun0-mls.pcd", mls_points); }