PCL 库使用资料
在 ubuntu18.04 上使用pcl记录
一、 安装
- 首先需要在 ubuntu 上安装c 库
sudo apt install libpcl-dev
dpkg -S pcl
查看包文件安装的位置,包括头文件和库文件,进到库文件路径下看,目前安装的是 pcl 1.8.1
/usr/include/pcl-1.8/pcl/sample_consensus/model_types.h #c 头文件
/usr/lib/x86_64-linux-gnu/ #c 库文件
lrwxrwxrwx 1 root root 23 9月 10 2018 libpcl_surface.so.1.8 -> libpcl_surface.so.1.8.1
- 点云python包 github 链接
下载这个 repo, 按照 repo 给出的命令从源码生成 python binding 文件并安装包
python setup.py build_ext -i
python setup.py install
这一部会报错,ld找不到响应版本的链接库,ubuntu18.04 自动安装 pcl1.8.1 和vtk7.1,而setup.py 中是 vtk7.0, 需要把 setup.py 中的 vtk_version 改成7.1,再执行以上命令。
安装的结果
SENSETIME\yangchengwei@cn0214002744l:~/.local/lib/python3.6/site-packages/python_pcl-0.3.0rc1-py3.6-linux-x86_64.egg/pcl$ ls -1
__init__.py
_pcl.cpython-36m-x86_64-linux-gnu.so
_pcl.py
pcl_visualization.cpython-36m-x86_64-linux-gnu.so
pcl_visualization.py
__pycache__
PKG_INFO的结果如下:
Metadata-Version: 2.1
Name: python-pcl
Version: 0.3.0rc1
跑 example/simple_visualize.py 的结果能看到点云,并且 pcl_visualization tool 能进行旋转多角度观察(需要换个点云文件,可以用 examples/official/Surface/bun0.pcd)
pcl api文档 https://pcl.readthedocs.io/projects/tutorials/en/latest/index.html
二、过程日志
从源码 安装 python pcl 的日志
running build_ext
skipping 'pcl/_pcl_180.cpp' Cython extension (up-to-date)
skipping 'pcl/pcl_visualization.cpp' Cython extension (up-to-date)
building 'pcl._pcl' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DEIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET=1 -I/home/SENSETIME/yangchengwei/.local/lib/python3.6/site-packages/numpy/core/include -I/usr/include/pcl-1.8 -I/usr/include/ni -I/usr/include/openni2 -I/usr/include/eigen3 -I/usr/include/ni -I/usr/include/openni2 -I/usr/include/vtk-7.1 -I/usr/include/python3.6m -c pcl/_pcl_180.cpp -o build/temp.linux-x86_64-3.6/pcl/_pcl_180.o -std=c++11
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DEIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET=1 -I/home/SENSETIME/yangchengwei/.local/lib/python3.6/site-packages/numpy/core/include -I/usr/include/pcl-1.8 -I/usr/include/ni -I/usr/include/openni2 -I/usr/include/eigen3 -I/usr/include/ni -I/usr/include/openni2 -I/usr/include/vtk-7.1 -I/usr/include/python3.6m -c pcl/minipcl.cpp -o build/temp.linux-x86_64-3.6/pcl/minipcl.o -std=c++11
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DEIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET=1 -I/home/SENSETIME/yangchengwei/.local/lib/python3.6/site-packages/numpy/core/include -I/usr/include/pcl-1.8 -I/usr/include/ni -I/usr/include/openni2 -I/usr/include/eigen3 -I/usr/include/ni -I/usr/include/openni2 -I/usr/include/vtk-7.1 -I/usr/include/python3.6m -c pcl/ProjectInliers.cpp -o build/temp.linux-x86_64-3.6/pcl/ProjectInliers.o -std=c++11
x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/pcl/_pcl_180.o build/temp.linux-x86_64-3.6/pcl/minipcl.o build/temp.linux-x86_64-3.6/pcl/ProjectInliers.o -L/usr/lib/x86_64-linux-gnu/ -lpcl_keypoints -lpcl_outofcore -lpcl_people -lpcl_recognition -lpcl_registration -lpcl_segmentation -lpcl_features -lpcl_ml -lpcl_stereo -lpcl_surface -lpcl_tracking -lpcl_filters -lpcl_sample_consensus -lpcl_visualization -lpcl_io -lOpenNI -lOpenNI2 -lpcl_search -lpcl_kdtree -lflann -lflann_cpp -lpcl_octree -lpcl_common -o /home/SENSETIME/yangchengwei/900G/coding/github/python-pcl-master/pcl/_pcl.cpython-36m-x86_64-linux-gnu.so
building 'pcl.pcl_visualization' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DEIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET=1 -I/home/SENSETIME/yangchengwei/.local/lib/python3.6/site-packages/numpy/core/include -I/usr/include/pcl-1.8 -I/usr/include/ni -I/usr/include/openni2 -I/usr/include/eigen3 -I/usr/include/ni -I/usr/include/openni2 -I/usr/include/vtk-7.1 -I/usr/include/python3.6m -c pcl/pcl_visualization.cpp -o build/temp.linux-x86_64-3.6/pcl/pcl_visualization.o -std=c++11
x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/pcl/pcl_visualization.o -L/usr/lib/x86_64-linux-gnu/ -lpcl_keypoints -lpcl_outofcore -lpcl_people -lpcl_recognition -lpcl_registration -lpcl_segmentation -lpcl_features -lpcl_ml -lpcl_stereo -lpcl_surface -lpcl_tracking -lpcl_filters -lpcl_sample_consensus -lpcl_visualization -lpcl_io -lOpenNI -lOpenNI2 -lpcl_search -lpcl_kdtree -lflann -lflann_cpp -lpcl_octree -lpcl_common -o /home/SENSETIME/yangchengwei/900G/coding/github/python-pcl-master/pcl/pcl_visualization.cpython-36m-x86_64-linux-gnu.so