一、代码
C++
downsampling.hpp
#pragma once
#ifndef DOWNSAMPLING_H
#define DOWNSAMPLING_H
#include <iostream>
#include <pcl/point_types.h>
#include <pcl/point_cloud.h>
#include <pcl/io/pcd_io.h>
#include <pcl/search/kdtree.h>
#include <pcl/visualization/pcl_visualizer.h>
#include <boost/thread/thread.hpp>
#include <pcl/filters/voxel_grid.h>//体素网格下采样
#include <pcl/filters/approximate_voxel_grid.h>//近似体素网格下采样
#include <pcl/filters/random_sample.h>//随机下采样
#include <pcl/keypoints/uniform_sampling.h>//均匀下采样
#include <pcl/surface/mls.h>//最小二乘法下采样
#include <pcl/filters/statistical_outlier_removal.h>//统计滤波
typedef pcl::PointXYZ PointT;
typedef pcl::PointCloud