【记录】PCL 滤波 Filtering a PointCloud using a PassThrough filter 直通滤波

本文详细记录了如何使用PCL库的PassThrough滤波器对点云数据进行处理。通过设置不同的字段名如'z'和'intensity',并调整滤波限制范围,实现去除高度或强度超出指定范围的点。正向过滤与反向过滤的使用也是关键步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

官网在哪里啊官网在这里:http://www.pointclouds.org/documentation/tutorials/passthrough.php#passthrough

passthrough.cpp

// 官网教程:http://pointclouds.org/documentation/tutorials/passthrough.php#passthrough
// 在官网教程基础上选择实例pcd文件
// 增加点云可视化部分代码,实例pcd文件为XYZI格式,可视化颜色根据pcd文件"intensity"属性生成
// 增加计时部分代码,使用PCL自带的计时函数计时

#include <iostream>
#include <pcl/io/pcd_io.h>
#include <ctime>
#include <pcl/point_types.h>
#include <pcl/filters/passthrough.h>
#include <pcl/common/time.h> // 计时
// 可视化相关头文件都一起堆在这儿
#include <thread>
#include <pcl/common/common_headers.h>
#include <pcl/features/normal_3d.h>
#include <pcl/visualization/pcl_visualizer.h>
#include <pcl/console/parse.h>

int
main(int argc, char** argv)
{
	// srand(time(0));
	pcl::StopWatch time; // 计时开始

	pcl::PointCloud<pcl::PointXYZI>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZI>);
	pcl::PointCloud<pcl::PointXYZI>::Ptr cloud_filtered(new pcl::PointCloud<pcl::PointXYZI>);
	//填入点云数据
	/* cloud->width  = 5;
	cloud->height = 1;
	cloud->points.resize (cloud->width * cloud-&g
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值