int main(int argc, char** argv) { /* Step 0 */ if (!cmd_arguments.ParseCommandLineArgument(argc, argv)) return -1; /* Step 1 */ std::cout << "Load pcd file ...\n"; pcl::io::loadPCDFile(cmd_arguments.raw_pcd_, *cloud); std::cout << "Before resample, #points = " << cloud->points.size() << std::endl; std::cout << "Resample ...\n"; pcl::PointCloud<pcl::PointXYZ>::Ptr sample(new pcl::PointCloud<pcl::PointXYZ>); // create the filtering object pcl::VoxelGrid<pcl::PointXYZ> grid; grid.setInputCloud(cloud); //grid.setLeafSize(size_x, size_y, size_z); grid.setLeafSize(cmd_arguments.resample_resolution_[0],cmd_arguments.resample_resolution_[1], cmd_arguments.resample_resolution_[2]); grid.filter(*sample); /* Step 2 */ std::cout << "After resample, #points = " << sample->points.size() << std::endl; std::cout << "Saving ...\n"; pcl::io::savePCDFile(cmd_arguments.raw_pcd_, *sample); return 0; }
int main (int argc, char** argv) { /* Step 0 */ if (!cmd_arguments.ParseCommandLineArgument(argc, argv)) return -1; /* Step 1 */ cout << "\n=========== Load raw building point cloud ... ==================\n"; pcl::io::loadPCDFile(cmd_arguments.raw_pcd_, *build_cloud_raw); /* Step 2 */ cout << "\n=========== Extract the building plane ... ==================\n"; ExtractBuildPlane(); /* Step 3 */ cout << "\n=========== Showing the building plane ... ==================\n"; ShowCloud(); }