2019年7月9日14:31:13
完成了一個簡單的小例子,python生成點雲數據,利用pybind11傳給PCL顯示。
ubuntu 16.04 + Anaconda3 python3.6 + PCL 1.8 + pybind11
代碼: https://github.com/necroen/py_pcd_visualization
效果圖如下:
搞深度估計,一直需要點雲庫PCL的python接口,未來還需要用到PCL中的某些功能。
然而好像沒有什么資料和例子。
github上也只有一個看起來不怎么完善的庫: https://github.com/strawlab/python-pcl
看起來就不太好編譯,沒玩過。然后想着自己用pybind11封裝需要的功能。
用的是高博slam14講代碼里ch5 joinMap的數據:
https://github.com/gaoxiang12/slambook/tree/master/ch5/joinMap
基本上就是把pybind11的例子和PCL的例子揉合到一塊
pybind11的例子:
https://github.com/tdegeus/pybind11_examples
https://www.jianshu.com/p/c912a0a59af9
PCL的例子:
https://blog.csdn.net/fsencen/article/details/79386570
注意點:
1,pybind11的python編譯器要指定
2,pybind11文件夾放在cpp文件同級目錄
3,pybind11中target_library的用法
其實我之前折騰了好幾天試圖把ros的package用pybind11封裝成庫給python
用,沒成功,如果這個弄出來會更省事,然而ros包的編譯過程改不動。。。