用体元滤波器进行降低采样
来源:互联网 发布:人工智能英语作文 编辑:程序博客网 时间:2024/05/29 11:19
我们这次用voxel filter(体元滤波器)来滤波
#include <iostream>#include <pcl/io/pcd_io.h>#include <pcl/point_types.h>#include <pcl/filters/voxel_grid.h>intmain (int argc, char** argv){ pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2 ()); pcl::PCLPointCloud2::Ptr cloud_filtered (new pcl::PCLPointCloud2 ()); // Fill in the cloud data pcl::PCDReader reader; // Replace the path below with the path where you saved your file reader.read ("table_scene_lms400.pcd", *cloud); // Remember to download the file first! std::cerr << "PointCloud before filtering: " << cloud->width * cloud->height << " data points (" << pcl::getFieldsList (*cloud) << ")."; // Create the filtering object pcl::VoxelGrid<pcl::PCLPointCloud2> sor; sor.setInputCloud (cloud); sor.setLeafSize (0.01f, 0.01f, 0.01f); sor.filter (*cloud_filtered); std::cerr << "PointCloud after filtering: " << cloud_filtered->width * cloud_filtered->height << " data points (" << pcl::getFieldsList (*cloud_filtered) << ")."; pcl::PCDWriter writer; writer.write ("table_scene_lms400_downsampled.pcd", *cloud_filtered, Eigen::Vector4f::Zero (), Eigen::Quaternionf::Identity (), false); return (0);}
以下是一些解释
从磁盘中读取文件
// Fill in the cloud data pcl::PCDReader reader; // Replace the path below with the path where you saved your file reader.read ("table_scene_lms400.pcd", *cloud); // Remember to download the file first!
然后我们用了VoxelGrid这个滤波器,过滤的尺寸为1cm
pcl::VoxelGrid<pcl::PCLPointCloud2> sor; sor.setInputCloud (cloud); sor.setLeafSize (0.01f, 0.01f, 0.01f); sor.filter (*cloud_filtered);
最终把数据存到磁盘里面
pcl::PCDWriter writer; writer.write ("table_scene_lms400_downsampled.pcd", *cloud_filtered, Eigen::Vector4f::Zero (), Eigen::Quaternionf::Identity (), false);
运行结果,可以看到这把计算量降低到原来的大约十分之一
PointCloud before filtering: 460400 data points (x y z intensity distance sid).PointCloud after filtering: 41049 data points (x y z intensity distance sid).
1 0
- 用体元滤波器进行降低采样
- VoxelGrid滤波器对点云降采样,并使用PCLVisulizer进行显示
- 使用VoxelGrid滤波器对点云降采样,并使用PCLVisulizer进行显示
- 利用PCL处理Realsense点云数据-使用VoxelGrid滤波器对点云进行下采样
- android 降低音频采样频率 downsample
- usrpL0变采样滤波器的性能优化
- 上采样与插值滤波器
- 卷积与采样还原、滤波器的联系(应用篇)
- VTK对点进行采样
- matlab 进行滤波器设计方法
- 对图像进行上采样和下采样
- 利用ALSA库进行音频重采样
- 用MATLAB对图像进行采样处理
- 使用options对象进行二次采样
- envi 对图片进行降采样
- 如何进行滤波器设计软件选择
- 96年lbc96322号提案---用自适应的环滤波器来降低块效应
- 采样
- 017.php跳出循环break和continue
- 虚析构的作用
- 大型广告系统架构 — 检索模块
- 图片轮换特效
- 什么是定时器
- 用体元滤波器进行降低采样
- ES6-新数据结构Set与WeakSet
- 你真的会写单例模式吗
- 018.php函数
- 题目1153:括号匹配问题
- margin(边界)、border(框边)、padding(填充)、content(填充)
- Lua进阶
- Leetcode 85. Maximal Rectangle
- 使用字符串资源