This is a small python binding to the pointcloud library. Currently, the following parts of the API are wrapped (all methods operate on PointXYZ) point types
- I/O and integration; saving and loading PCD files
- segmentation
- SAC
- smoothing
- filtering
- registration (ICP, GICP, ICP_NL)
The code tries to follow the Point Cloud API, and also provides helper function for interacting with numpy. For example (from tests/test.py)
import pcl
import numpy as np
p = pcl.PointCloud(np.array([[1, 2, 3], [3, 4, 5]], dtype=np.float32))
seg = p.make_segmenter()
seg.set_model_type(pcl.SACMODEL_PLANE)
seg.set_method_type(pcl.SAC_RANSAC)
indices, model = seg.segment()
or, for smoothing
import pcl
p = pcl.load("C/table_scene_lms400.pcd")
fil = p.make_statistical_outlier_filter()
fil.set_mean_k (50)
fil.set_std_dev_mul_thresh (1.0)
fil.filter().to_file("inliers.pcd")
More samples can be found in the examples directory, and in the unit tests.
This work was supported by Strawlab.
This release has been tested on Ubuntu 13.10 with
- Python 2.7.5
- pcl 1.7.1
- Cython 0.21
and CentOS 6.5 with
- Python 2.6.6
- pcl 1.6.0
- Cython 0.21
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.
.. autosummary:: pcl.PointCloud pcl.Segmentation pcl.SegmentationNormal pcl.StatisticalOutlierRemovalFilter pcl.MovingLeastSquares pcl.PassThroughFilter pcl.VoxelGridFilter
For deficiencies in this documentation, please consult the PCL API docs, and the PCL tutorials.
.. automodule:: pcl :members: :undoc-members: