在Windows10和Ubuntu下安装python-pcl的方法

本文背景:在新时代的号召下,我们的图像分析和处理工作从2D发展到了3D,从Opencv的熟练使用进化到了PCL的探索之路。下面这句话是全文的核心,希望所有想在Windows上安装python-pcl的人都能立刻回头,不要再做无谓的抵抗。

《在Windows10和Ubuntu下安装python-pcl的方法》

所有试图用Windows安装python-pcl的行为都是浪费时间,请立刻为你的电脑装上Ubuntu。

这里不是说win上不能安装python-pcl,而是说在win上安装真的非常麻烦且成功率低下,如果你觉得windows使用方便,那在win上安装python-pcl的过程会让你改变观念。

(如果你非要在Windows上试试,私信我给你教程)

下面我们正式开始:

1.安装环境:Ubuntu14.04(这里是镜像文件,如果下载不了请私信我—>ubuntu-14.04-desktop-amd64.iso

说明:我之前尝试了16.04,但失败了,python-pcl在16.04上比14.04上安装过程长很多,要知道每多出一条命令安装成功率就会以指数形式下降..所以请使用14.04。python为14.04自带的python2.7.6,最好不要自己改成python3。另外,不要使用anaconda,miniconda,看似一揽子解决了很多问题,但在这里效果并不理想。

2.安装python-pcl

将下面这4行sudo依次运行,新装的系统不会出error,出现warning可以当没看见。

sudo apt-get install software-properties-common python-software-properties

sudo add-apt-repository ppa:v-launchpad-jochen-sprickerhof-de/pcl

sudo apt-get update

sudo apt-get install libpcl-all

3.安装python binding

下面9行依次运行,如果提示没有什么模块,那就按提示安装即可,大问题或者大Error应该不会有,出现warning当没看见,命令注意大小写。

sudo apt-get install python-pip

sudo apt-get install python-dev

sudo pip install Cython==0.25.2

sudo pip install numpy

sudo apt-get install git

git clone https://github.com/strawlab/python-pcl.git

cd python-pcl/

python setup.py build_ext -i(这两行如果运行有error就在前面加上sudo)

python setup.py install(这两行如果运行有error就在前面加上sudo)

至此,如果没有Error那就是装好了,你可以打开编译器(比如spyder)随便跑一段例程试试,在你import pcl并运行时不会提示pcl不存在。(例程在这里——>https://github.com/strawlab/python-pcl)

4.总结

是的,就这么简单,但是这个探索过程花了半个月,从Windows上到了16.04上又到了14.04上,从python3.6到了3.5又到了2.7。


现在给我的感觉是Ubuntu16.04和python3.5也能安装,之前没安装上可能是因为某一步稀里糊涂的出现了问题,接下来我会尝试在16.04和3.5环境下安装python-pcl
  更新:我带着成功的经验又一次尝试了16.04和Python3.5,结果还是失败了,所以还是请用14.04和Python2.7吧。

之后会更新点云对比的相关研究,喜欢就加一波关注吧。

参考文献:

1.Github python-pcl source  https://github.com/strawlab/python-pcl

2.[PCL][Python][CPP]Python PCL (Point Cloud Library)のインストールとサンプル実行 http://zuqqhi2.com/python-pcl

3. CloudViewer    http://pointclouds.org/documentation/tutorials/cloud_viewer.php#cloud-viewer

4.Windows10下配置python-pcl过程    https://www.jianshu.com/p/5d5bb85537d2?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

5.Visual Studio 2015でPCL1.8.0を使う    http://pcl.hatenablog.com/entry/2016/12/12/003738

6.【SLAM】之Point Cloud Library(PCL)简介与安装    https://blog.csdn.net/littlethunder/article/details/51912199

7.用python学习slam系列(一)从图像到点云    http://www.rosclub.cn/post-682.html

8.Anaconda cloud      https://anaconda.org/ccordoba12/python-pcl

5.更高端的例程

如果你上面跑通了这里肯定没问题,不做也无妨。

如果你一定要试试,可以看这里,从RUN SAMPLE开始往下看——>http://zuqqhi2.com/python-pcl

以上

2018/04/23

    原文作者:宏阳_Tommy
    原文地址: https://www.jianshu.com/p/d748f27f2371
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞