void setLeafSize (const Eigen::Vector4f &leaf_size) 通过向量设置体素栅格leaf_ size。 void setLeafSize (float lx, float ly, float lz) 通过lx.ly.Iz分别设置体素栅格在XYZ 3个方向上的尺寸。 Eigen::Vector3f getLeafSize () 获得设置体素栅格的向量。 void setDownsampleAllData (bool downsample...
VS2019编译PCL1.11.1源码 最近在使用PCL的体素滤波器进行点云降采样时,遇到了 Leaf size is too small for the input dataset 的报错,出于某些原因,并不想简单的增大 Leaf size 来解决这个问题。尝试修改了PCL的源码,但是很可惜,对源码的改动并不能直接应用到我的项目中,于是只能被迫对PCL的 source code 进行重...
(const ApproximateVoxelGrid &src) // 复制构造函数 ~ApproximateVoxelGrid () // 析构函数 ApproximateVoxelGrid & operator= (const ApproximateVoxelGrid &src) // 定义运算发重载函数 void setLeafSize (const Eigen::Vector3f &leaf_size) // 设置体素栅格叶大小,向量参数leaf_size是体素栅格叶大小参数,每个...
sor.setLeafSize(0.01f,0.01f,0.01f);//设置滤波时创建的体素体积为1cm的立方体sor.filter(*cloud_filtered);//执行滤波处理,存储输出std::cerr <<"PointCloud after filtering: "<< cloud_filtered->width * cloud_filtered->height <<" data points ("<< pcl::getFieldsList(*cloud_filtered) <<")."...
pcl::PointCloud::Ptrcloud(newpcl::PointCloud);// 读取点云数据pcl::ApproximateVoxelGridvoxel_filter;voxel_filter.setInputCloud(cloud);voxel_filter.setLeafSize(0.01f,0.01f,0.01f);// 设置体素大小pcl::PointCloud::Ptrfiltered_cloud(newpcl::PointCloud);voxel_filter.filter(*filtered_cloud);// 进行...
sor.setLeafSize(0.01f, 0.01f, 0.01f); //设置体素大小,单位:m sor.filter(*cloud_filtered); //进行下采样 1. 2. 3. 4. 1.3 均匀采样 均匀采样的原理类似于体素化网格采样方法,同样是将点云空间进行划分,不过是以半径=r的球体,在当前球体所有点中选择距离球体中心最近的点替代所有点,注意,此时点的位...
setLeafSize(lx, ly, lz);//设置滤波时创建的体素大小为lx m*ly m*lz m的立方体 vox_grid.setInputCloud(cloud_in); vox_grid.filter(*cloud_out); std::cout << "size after voxelFilter: " << cloud_out->size() << std::endl; } ...
voidvoxel_filter(constpcl::PointCloud<PointXYZRGB>::Ptr &input_cloud,floatresolution)//体素化滤波器 { pcl::VoxelGrid<PointXYZRGB> voxel_grid; //构建体素化滤波器 voxel_grid.setInputCloud(input_cloud); //设置输入点云 voxel_grid.setLeafSize(resolution,...
为了使用Voxel Grid Filter对原始点云进行降采样,只需定义 pcl::VocelGrid 并且指定输入点云和leaf size,在本例中,我们使用leaf size为 0.2。Voxel Grid Filter将输入点云使用0.2m*0.2m*0.2m的立方体进行分割,使用小立方体的形心(centroid)来表示这个立方体的所有点,保留这些点作为降采样的输出。
setLeafSize(0.2, 0.2, 0.2); approximate_voxel_filter.setInputCloud(input_cloud); approximate_voxel_filter.filter(*filtered_cloud); std::cout << "Filtered cloud contains " << filtered_cloud->size() << " data points from room_scan2.pcd" << std::endl; // 初始化正态分布(NDT)对象 pcl...