Advertisement

PCL中的点云采样采用固定输出点数即随机采样

阅读量:

背景:

该算法在 pcl 官方文档中并未提供相应的操作指南。

注:在特定应用场景下,往往需要保持点云数据集中点的数量维持在一个固定值。为实现这一目标,通常会采用点云数据的下采样处理方式。pcl 中的 voxel grid filter 虽然具备下采样的功能,但无法确保输出点数量的稳定性,而 Random Sample 方法则能够满足这一需求。本人也自行编写了一个具有类似功能的算法,点击打开链接

1. 代码:

复制代码
 #include <pcl/filters/random_sample.h>

    
 #include <pcl/point_types.h>
    
 #include <pcl/io/pcd_io.h>
    
 #include <pcl/visualization/pcl_visualizer.h>
    
 #include <pcl/common/transforms.h>
    
  
    
 #define PI 3.1415
    
  
    
 #include <vector>
    
  
    
 typedef pcl::PointXYZ PointT;
    
 typedef pcl::PointCloud<PointT> PointCloudT;
    
  

全部评论 (0)

还没有任何评论哟~