博客
关于我
【点云StatisticalOutlierFilter】python-pcl:去除离群点
阅读量:204 次
发布时间:2019-02-28

本文共 779 字,大约阅读时间需要 2 分钟。

点云去除离群点

方法:使用K近邻方法进行点云处理,通过计算标准距离筛选离群点。具体实现如下:

原理:K近邻算法用于确定每个点的邻近点数,计算标准距离。设置离群点的标准为距离超过标准距离乘以系数后的点数。

结果:将点云分为内点和离群点两部分。通过设置参数,可选保存离群点或保留内点的点云文件。

官方示例效果表现为:通过去除柱子腿周围的离散点,显著清洁了点云数据。

注意:在实际应用中,点云密度较大时,效果可能会受到影响,建议根据具体需求调整参数。

import pcldef main():    # 加载点云数据    p = pcl.load("D:/tests/tutorials/table_scene_lms400.pcd")        # 初始化滤镜并设置参数    fil = p.make_statistical_outlier_filter()    fil.set_mean_k(50)  # 设置近邻点数    fil.set_std_dev_mul_thresh(1.0)  # 设置标准差倍数        # 过滤并保存内点    inlier_cloud = fil.filter()    pcl.save(inlier_cloud, "D:/tests/tutorials/table_scene_lms400_inliers.pcd")        # 设置保存离群点    fil.set_negative(True)    outlier_cloud = fil.filter()    pcl.save(outlier_cloud, "D:/tests/tutorials/table_scene_lms400_outliers.pcd")if __name__ == "__main__":    main()

转载地址:http://oaai.baihongyu.com/

你可能感兴趣的文章
npm安装crypto-js 如何安装crypto-js, python爬虫安装加解密插件 找不到模块crypto-js python报错解决丢失crypto-js模块
查看>>
npm安装教程
查看>>
npm报错Cannot find module ‘webpack‘ Require stack
查看>>
npm报错Failed at the node-sass@4.14.1 postinstall script
查看>>
npm报错fatal: Could not read from remote repository
查看>>
npm报错File to import not found or unreadable: @/assets/styles/global.scss.
查看>>
npm报错TypeError: this.getOptions is not a function
查看>>
npm报错unable to access ‘https://github.com/sohee-lee7/Squire.git/‘
查看>>
npm淘宝镜像过期npm ERR! request to https://registry.npm.taobao.org/vuex failed, reason: certificate has ex
查看>>
npm版本过高问题
查看>>
npm的“--force“和“--legacy-peer-deps“参数
查看>>
npm的安装和更新---npm工作笔记002
查看>>
npm的常用操作---npm工作笔记003
查看>>
npm的常用配置项---npm工作笔记004
查看>>
npm的问题:config global `--global`, `--local` are deprecated. Use `--location=global` instead 的解决办法
查看>>
npm编译报错You may need an additional loader to handle the result of these loaders
查看>>
npm设置淘宝镜像、升级等
查看>>
npm设置源地址,npm官方地址
查看>>
npm设置镜像如淘宝:http://npm.taobao.org/
查看>>
npm配置安装最新淘宝镜像,旧镜像会errror
查看>>