python-pcl installation and examples
程序员文章站
2022-03-29 19:39:00
...
Reference github link: https://github.com/strawlab/python-pcl/blob/master/appveyor.yml
1. Installation in Ubuntu16.04
sudo apt install libpcl-dev -y
pip install python-pcl
2. statistical outlier filter: using a recursive function
# -*- coding: utf-8 -*-
# port of
# http://pointclouds.org/documentation/tutorials/statistical_outlier.php
# you need to download
# http://svn.pointclouds.org/data/tutorials/table_scene_lms400.pcd
import pcl
def sta_filter(p_cloud, neg_p_cloud, ponit_num, p_totalnum):
if ponit_num > int(0.75*p_totalnum):
print('filtering...')
fil = p_cloud.make_statistical_outlier_filter()
fil.set_mean_k(ponit_num)
fil.set_std_dev_mul_thresh(1.0)
new_p_cloud = fil.filter()
new_p_num = new_p_cloud.size
fil.set_negative(True)
neg_p_cloud = fil.filter()
sta_filter(new_p_cloud, neg_p_cloud, new_p_num, p_totalnum)
else:
pcl.save(p_cloud,
"./pcldata/tutorials/test_1_inliers.pcd")
pcl.save(neg_p_cloud,
"./pcldata/tutorials/test_1_outliers.pcd")
if __name__ == "__main__":
pcdfile = './pcldata/tutorials/test_1.pcd'
p_cloud = pcl.load(pcdfile)
ponit_num = p_cloud.size
p_totalnum = ponit_num
sta_filter(p_cloud, p_cloud, ponit_num, p_totalnum)
推荐阅读
-
AndroidStudio更新时报错:Connection Error,Temp directory inside installation
-
Realcase: Failed to upgrade SQL Server 2016 SP2 CU11. (Installation success or error status: 1648)
-
Ubuntu安装telent服务器时出现:apt-get:Package has no installation的原因及解决方法
-
Packet Analyzer: 15 TCPDUMP Command Examples
-
The packaging and installation process of Android programs
-
wicket-examples示例. wicket
-
[转发] Apache SSL Certificate Installation
-
Rails4 Web installation
-
Rails4 Web installation
-
kali遇到“已安装的 post-installation 脚本 返回了错误的问题的解决