This is a small python binding to the pointcloud library. Currently, the following parts of the API are wrapped (all methods operate on PointXYZRGB) point types
- I/O and integration; saving and loading PCD files
The code tries to follow the Point Cloud API, and also provides helper function for interacting with NumPy.
Point clouds can be viewed as NumPy arrays, so modifying them is possible using all the familiar NumPy functionality:
import numpy as np import pcl p = pcl.PointCloud(10) # "empty" point cloud a = np.asarray(p) # NumPy view on the cloud a[:] = 0 # fill with zeros print(p) # prints (0.0, 0.0, 0.0) a[:, 0] = 1 # set x coordinates to 1 print(p) # prints (1.0, 0.0, 0.0)
This library is developed for use in our Project Patty, see this repository for more interesting examples. Also, the reading and writing of LAS files is implemented there.
This release has been tested on Linux Mint 17 with
- Python 2.7.9
- pcl 1.7.2
- Cython 0.22
A note about types
Point Cloud is a heavily templated API, and consequently mapping this into Python using Cython is challenging.
It is written in Cython, and implements enough hard bits of the API (from Cythons perspective, i.e the template/smart_ptr bits) to provide a foundation for someone wishing to carry on.
.. automodule:: pcl :members: :undoc-members: :imported-members:
.. automodule:: pcl.registration :members: :undoc-members:
.. automodule:: pcl.boundaries :members: :undoc-members: