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
- segmentation
- SAC
- smoothing
- filtering
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[3]) # prints (0.0, 0.0, 0.0)
a[:, 0] = 1 # set x coordinates to 1
print(p[3]) # prints (1.0, 0.0, 0.0)
More samples can be found in the examples directory, and in the unit tests.
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 work was supported by Strawlab and the Netherlands eScience Center
This release has been tested on Linux Mint 17 with
- Python 2.7.9
- pcl 1.7.2
- Cython 0.22
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.
For API documentation, look at our gh-pages branch For deficiencies in this documentation, please consult the PCL API docs, and the PCL tutorials.
.. automodule:: pcl :members: :undoc-members: :imported-members:
.. automodule:: pcl.registration :members: :undoc-members:
.. automodule:: pcl.boundaries :members: :undoc-members: