#include <iostream>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <pcl/ModelCoefficients.h>
#include <pcl/filters/extract_indices.h>
#include <pcl/filters/voxel_grid.h>
#include <pcl/features/normal_3d.h>
#include <pcl/sample_consensus/method_types.h>
#include <pcl/sample_consensus/model_types.h>
#include <pcl/segmentation/sac_segmentation.h>
#include <pcl/visualization/cloud_viewer.h>
typedef pcl::PointXYZ PointT;
int main (int argc, char** argv)
{
// 创建点云对象
pcl::PointCloud<PointT>::Ptr cloud (new pcl::PointCloud<PointT>);
// 从文件加载点云数据
if (pcl::io::loadPCDFile<PointT>("/path/to/your/pointcloud.pcd", *cloud) == -1)
{
PCL_ERROR("Couldn't read file 'pointcloud.pcd'\n");
return -1;
}
// 下采样(可选)
pcl::VoxelGrid<PointT> vg;
vg.setInputCloud(cloud);
vg.setLeafSize(0.01f, 0.
PCL平面点云聚类计算法向量-可视化
于 2023-09-11 18:21:18 首次发布