4

3d激光雷达开发(PassThrough滤波器)

 2 years ago
source link: https://blog.csdn.net/feixiaoxing/article/details/123321591
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

3d激光雷达开发(PassThrough滤波器)

费晓行 已于 2022-03-07 08:40:32 修改 117

【 声明:版权所有,欢迎转载,请勿用于商业用途。 联系信箱:feixiaoxing @163.com】

        这个滤波器可能是最简单的那一类滤波器。有点类似于opencv里面的roi,也就是感兴趣区域。简单来说,这个滤波器就是对点云数据做一个裁剪,把某一个轴上面的数据段保留下来,或者剔除。原来的代码链接在这,https://pcl.readthedocs.io/projects/tutorials/en/master/passthrough.html#passthrough

1、准备passthrough.cpp文件

newCodeMoreWhite.png

2、代码分析

        整个代码段里面,最重要的部分就是pass.setFilterFieldName和pass.setFilterLimits这两句话。前者是说面对哪一个方向的数据进行处理,后面一句设置处理的范围。后面还有一句,pass.setFilterLimitsNegative是说保留范围内的数据,还是保留范围之外的数据。

3、准备CMakeLists.txt

4、编译生成sln工程,开始链接

        cmake之后,应该可以正常编译成功

5、执行passthrough.exe

        执行过程中,可能出现dll不全的情况,补全就好了。

        此外,执行过程中还可能出现filter之后,没有数据的情况,这主要是因为setFilterLimits过小的原因,可以设置的再大一点,另外随机生成的数据再多一点,效果也会好很多。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK