Python bindings for the Point Cloud Library
Project description
pclpy: Point Cloud Library for python
Automatically generated python bindings for the Point Cloud Library (PCL) using pybind11 and CppHeaderParser.
The library is in early stage and in active development, do not use in production. The api is likely to change.
Only Windows x64 and python 3.6 are supported at the moment.
Contributions, issues, comments are welcome!
Github repository: https://www.github.com/davidcaron/pclpy Pypi: https://pypi-hypernode.com/project/pclpy/
Why another binding?
The python-pcl bindings contain a lot of repeated code. Maintaining, adding features or point types is quite tedious. While Cython is great, binding templated code isn't one of its strenghts. Also, python-pcl implement only a subset of PCL's classes and point types.
Using pybind11, we can use c++ templates directly. The goal is to wrap as much of the library as possible.
Installing
pip install pclpy
When pip installs the project, pclpy_dependencies
is installed as a requirement.
This small project contains only the PCL Windows dlls required.
Features
AllAbout half of the point types are implemented (those specified by the default msvc compile flags)- You can view point cloud data as numpy arrays using
cloud.x
orcloud.xyz
- boost::shared_ptr is handled by pybind11 so it's completely abstracted at the python level
Example
Here is how you would use the library to process Moving Least Squares. See the PCL documentation: http://pointclouds.org/documentation/tutorials/resampling.php
import pclpy
from pclpy import pcl
point_cloud = pclpy.io.read_las(test_data("street.las"))
mls = pcl.surface.MovingLeastSquaresOMP.PointXYZRGBA_PointNormal()
tree = pcl.search.KdTree.PointXYZRGBA()
mls.setSearchRadius(0.05)
mls.setPolynomialFit(False)
mls.setNumberOfThreads(12)
mls.setInputCloud(point_cloud)
mls.setSearchMethod(tree)
mls.setComputeNormals(True)
output = pcl.PointCloud.PointNormal()
mls.process(output)
You can see it's quite similar to the C++ version:
// C++ version
pcl::PointCloud<pcl::PointXYZ>::Ptr point_cloud (new pcl::PointCloud<pcl::PointXYZ> ());
pcl::io::loadPCDFile ("bun0.pcd", *point_cloud);
pcl::MovingLeastSquaresOMP<pcl::PointXYZ, pcl::PointNormal> mls;
pcl::search::KdTree<pcl::PointXYZ>::Ptr tree (new pcl::search::KdTree<pcl::PointXYZ>);
mls.setSearchRadius (0.05);
mls.setPolynomialFit (false);
mls.setNumberOfThreads (12);
mls.setInputCloud (point_cloud);
mls.setSearchMethod (tree);
mls.setComputeNormals (true);
pcl::PointCloud<pcl::PointNormal> output;
mls.process (output);
Modules
- These modules should work, but are untested
- 2d
- common
- geometry
- features
- filters
- io
- kdtree
- keypoints
- octree
- recognition
- sample_consensus
- search
- segmentation
- stereo
- surface
- tracking
- visualization
- These modules are skipped for now
- ml
- people
- outofcore
- registration
- every other module not built in the precompiled windows binaries
Not Implemented
(see todo.md
and the what to skip section in generators/config.py
)
To build
- Download PCL release for Windows (PCL-1.8.1-AllInOne-msvc2015-win64.exe) at: https://github.com/PointCloudLibrary/pcl/releases/download/pcl-1.8.1/PCL-1.8.1-AllInOne-msvc2015-win64.exe
- PCL_ROOT environment variable must be set to the installation directory of PCL
- About requirements:
- Install pybind11 from github (2.3dev version) it includes a necessary bug fix
- Install CppHeaderParser from https://github.com/davidcaron/CppHeaderParser (specific bug fixes)
- Generate modules using
generate_pybind11_bindings.py
- There is a missing file from the PCL release that you should get from the github repo: 2d/impl/kernel.hpp
- Must be built with x64 version of cl.exe because of the large memory usage (see workaround in setup.py)
- python setup.py install
- Useful setup.py arguments:
- --msvc-mp-build should enable a multiprocessed build
- --msvc-no-code-link makes linking much faster (do not use for releases, see setup.py description)
- --use-clcache to cache msvc builds using clcache (must be installed)
- --debug to build in debug mode
Roadmap
- Wrap as much of PCL as reasonably possible
- More tests
- CI on Appveyor
- Make it installable on Linux and Mac
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file pclpy-0.3.10-cp36-cp36m-win_amd64.whl
.
File metadata
- Download URL: pclpy-0.3.10-cp36-cp36m-win_amd64.whl
- Upload date:
- Size: 14.1 MB
- Tags: CPython 3.6m, Windows x86-64
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 249838329b1023ed98a7d6ba3a05f1aac154b8c560746cb65e52a51204cf9b5b |
|
MD5 | f8335d564f5cbc7eef6e44f1bf157ad9 |
|
BLAKE2b-256 | a5e3e8572bce4e8522c2a9ccf063c76ff6c4fead91493f2fa5b99112c7c8d66b |