All Projects → davidcaron → Pclpy

davidcaron / Pclpy

Licence: mit
Python bindings for the Point Cloud Library (PCL)

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pclpy

Lidar camera calibration
Light-weight camera LiDAR calibration package for ROS using OpenCV and PCL (PnP + LM optimization)
Stars: ✭ 133 (-37.26%)
Mutual labels:  point-cloud, lidar, pcl
Depth clustering
🚕 Fast and robust clustering of point clouds generated with a Velodyne sensor.
Stars: ✭ 657 (+209.91%)
Mutual labels:  point-cloud, lidar, pcl
Hdl graph slam
3D LIDAR-based Graph SLAM
Stars: ✭ 945 (+345.75%)
Mutual labels:  point-cloud, lidar
Point Cloud Filter
Scripts showcasing filtering techniques applied to point cloud data.
Stars: ✭ 34 (-83.96%)
Mutual labels:  point-cloud, pcl
Liblas
C++ library and programs for reading and writing ASPRS LAS format with LiDAR data
Stars: ✭ 211 (-0.47%)
Mutual labels:  point-cloud, lidar
Pcl
Point Cloud Library (PCL)
Stars: ✭ 6,897 (+3153.3%)
Mutual labels:  point-cloud, pcl
Lidar camera calibration
ROS package to find a rigid-body transformation between a LiDAR and a camera for "LiDAR-Camera Calibration using 3D-3D Point correspondences"
Stars: ✭ 734 (+246.23%)
Mutual labels:  point-cloud, lidar
Displaz
A hackable lidar viewer
Stars: ✭ 177 (-16.51%)
Mutual labels:  point-cloud, lidar
Interactive slam
Interactive Map Correction for 3D Graph SLAM
Stars: ✭ 372 (+75.47%)
Mutual labels:  point-cloud, lidar
Awesome Robotic Tooling
Tooling for professional robotic development in C++ and Python with a touch of ROS, autonomous driving and aerospace.
Stars: ✭ 1,876 (+784.91%)
Mutual labels:  point-cloud, lidar
Laser Camera Calibration Toolbox
A Laser-Camera Calibration Toolbox extending from that at http://www.cs.cmu.edu/~ranjith/lcct.html
Stars: ✭ 99 (-53.3%)
Mutual labels:  point-cloud, lidar
Pcl Ros Cluster Segmentation
Cluster based segmentation of Point Cloud with PCL lib in ROS
Stars: ✭ 123 (-41.98%)
Mutual labels:  point-cloud, pcl
Superpoint graph
Large-scale Point Cloud Semantic Segmentation with Superpoint Graphs
Stars: ✭ 533 (+151.42%)
Mutual labels:  point-cloud, lidar
Cloud annotation tool
L-CAS 3D Point Cloud Annotation Tool
Stars: ✭ 182 (-14.15%)
Mutual labels:  point-cloud, pcl
Loam noted
loam code noted in Chinese(loam中文注解版)
Stars: ✭ 455 (+114.62%)
Mutual labels:  lidar, pcl
Weakly Supervised 3d Object Detection
Weakly Supervised 3D Object Detection from Point Clouds (VS3D), ACM MM 2020
Stars: ✭ 61 (-71.23%)
Mutual labels:  point-cloud, lidar
Fast gicp
A collection of GICP-based fast point cloud registration algorithms
Stars: ✭ 307 (+44.81%)
Mutual labels:  point-cloud, pcl
Dynamic robot localization
Point cloud registration pipeline for robot localization and 3D perception
Stars: ✭ 339 (+59.91%)
Mutual labels:  lidar, pcl
Loam velodyne
Laser Odometry and Mapping (Loam) is a realtime method for state estimation and mapping using a 3D lidar.
Stars: ✭ 1,135 (+435.38%)
Mutual labels:  lidar, pcl
Extrinsic lidar camera calibration
This is a package for extrinsic calibration between a 3D LiDAR and a camera, described in paper: Improvements to Target-Based 3D LiDAR to Camera Calibration. This package is used for Cassie Blue's 3D LiDAR semantic mapping and automation.
Stars: ✭ 149 (-29.72%)
Mutual labels:  point-cloud, lidar

pclpy: PCL for python

conda Python version conda PCL version

.github/workflows/ci.yml

Python bindings for the Point Cloud Library (PCL). Generated from headers using CppHeaderParser and pybind11.

Install using conda: conda install -c conda-forge -c davidcaron pclpy (see Installation below)

Contributions, issues, comments are welcome!

Github repository: https://www.github.com/davidcaron/pclpy

Motivation

Many other python libraries tried to bind PCL. The most popular one being python-pcl, which uses Cython. While Cython is really powerful, binding C++ templates isn't one of its strenghts (and PCL uses templates heavily). The result for python-pcl is a lot of code repetition, which is hard to maintain and to add features to, and incomplete bindings of PCL's classes and point types.

Using pybind11, we use C++ directly. Templates, boost::smart_ptr and the buffer protocol are examples of things that are simpler to implement.

The results so far are very promising. A large percentage of PCL is covered.

Installation

We use conda to release pclpy. To install, use this command:

conda install -c conda-forge -c davidcaron pclpy

Don't forget to add both channels, or else conda won't be able to find all dependencies.

Windows: python 3.6 and 3.7 are supported

Linux: python 3.6, 3.7 and 3.8 are supported

Features

  • Most point types are implemented (those specified by PCL_ONLY_CORE_POINT_TYPES in PCL)
  • You can get a numpy view of point cloud data using python properties (e.g. cloud.x or cloud.xyz)
  • boost::shared_ptr is handled by pybind11 so it's completely abstracted at the python level
  • laspy integration for reading/writing las files

Example

You can use either a high level, more pythonic api, or the wrapper over the PCL api. The wrapper is meant to be as close as possible to the original PCL C++ api.

Here is how you would use the library to process Moving Least Squares. See the PCL documentation: http://pointclouds.org/documentation/tutorials/resampling.php

Using the higher level api:

import pclpy

# read a las file
point_cloud = pclpy.read("street.las", "PointXYZRGBA")
# compute mls
output = point_cloud.moving_least_squares(search_radius=0.05, compute_normals=True, num_threads=8)

Or the wrapper over the PCL api:

import pclpy
from pclpy import pcl

point_cloud = pclpy.read("street.las", "PointXYZRGBA")
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 the wrapper is very close to the C++ version:

// C++ version

pcl::PointCloud<pcl::PointXYZ>::Ptr point_cloud (new pcl::PointCloud<pcl::PointXYZ> ());
pcl::io::loadPCDFile ("bunny.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

  • 2d
  • common
  • geometry
  • features
  • filters
  • io (meshes are not implemented)
  • kdtree
  • keypoints
  • octree
  • recognition
  • sample_consensus
  • search
  • segmentation
  • stereo
  • surface
  • tracking

These modules are skipped for now

  • ml
  • people
  • outofcore
  • registration
  • visualization
  • every module not in the PCL Windows release (gpu, cuda, etc.)

Not Implemented

(see github issues and the what to skip section in generators/config.py)

Building

Build scripts are in the scripts folder.

  1. Create your conda environment: conda env create -n pclpy -f environment.yml

  2. Activate your environment: conda activate pclpy

  3. Install development dependencies: pip install -r requirements-dev.txt

  4. Download a copy of PCL Windows: powershell scripts\download_pcl.ps1 Linux: scripts\download_pcl.sh

  5. Generate pybind11 bindings Windows: powershell scripts\generate_points_and_bindings.ps1 Linux: scripts\generate_points_and_bindings.sh

  6. For development, build inplace using python python setup.py build_ext -i

    For a release, use the scripts/conda_build.bat (or conda_build.sh) script

On Windows, these setup.py arguments can cpeed up the build: - --msvc-mp-build enables a multiprocessed build - --msvc-no-code-link makes the linking step faster (not meant for releases) - --use-clcache to cache msvc builds (clcache must be installed)

Roadmap

  • Wrap as much of PCL as reasonably possible
  • More tests
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].