{"id":18461086,"url":"https://github.com/davidcaron/pclpy","last_synced_at":"2025-04-04T16:09:10.901Z","repository":{"id":41506664,"uuid":"127914787","full_name":"davidcaron/pclpy","owner":"davidcaron","description":"Python bindings for the Point Cloud Library (PCL)","archived":false,"fork":false,"pushed_at":"2021-03-08T16:41:19.000Z","size":20543,"stargazers_count":440,"open_issues_count":80,"forks_count":59,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-28T15:03:53.406Z","etag":null,"topics":["computer-vision","lidar","pcl","point-cloud","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidcaron.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-03T13:44:35.000Z","updated_at":"2025-03-26T16:25:41.000Z","dependencies_parsed_at":"2022-08-10T02:35:13.290Z","dependency_job_id":null,"html_url":"https://github.com/davidcaron/pclpy","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidcaron%2Fpclpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidcaron%2Fpclpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidcaron%2Fpclpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidcaron%2Fpclpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidcaron","download_url":"https://codeload.github.com/davidcaron/pclpy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247208143,"owners_count":20901570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-vision","lidar","pcl","point-cloud","python"],"created_at":"2024-11-06T08:29:46.463Z","updated_at":"2025-04-04T16:09:10.870Z","avatar_url":"https://github.com/davidcaron.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pclpy: PCL for python\n\n\n[![conda](https://img.shields.io/conda/v/davidcaron/pclpy?label=conda)](https://anaconda.org/davidcaron/pclpy)\n[![Python version](https://img.shields.io/badge/python-3.6%20%7C%203.7%20%7C%203.8-blue)](https://anaconda.org/davidcaron/pclpy)\n[![conda](https://img.shields.io/conda/pn/davidcaron/pclpy?color=orange)](https://anaconda.org/davidcaron/pclpy)\n[![PCL version](https://img.shields.io/badge/PCL-1.9.1-blue)](https://anaconda.org/conda-forge/pcl)\n\n![.github/workflows/ci.yml](https://github.com/davidcaron/pclpy/workflows/.github/workflows/ci.yml/badge.svg)\n\nPython bindings for the Point Cloud Library (PCL).\nGenerated from headers using CppHeaderParser and pybind11.\n\nInstall using conda: `conda install -c conda-forge -c davidcaron pclpy` (see _Installation_ below)\n\nContributions, issues, comments are welcome!\n\nGithub repository: https://www.github.com/davidcaron/pclpy\n\n## Motivation\n\nMany other python libraries tried to bind PCL.\nThe most popular one being python-pcl, which uses Cython.\nWhile Cython is really powerful, binding C++ templates isn't one of\nits strenghts (and PCL uses templates heavily).\nThe result for python-pcl is a lot of code repetition, which is hard\nto maintain and to add features to, and incomplete bindings of PCL's classes\nand point types.\n\nUsing pybind11, we use C++ directly. Templates, boost::smart_ptr and\nthe buffer protocol are examples of things that are simpler to implement.\n\nThe results so far are very promising. A large percentage of PCL is covered.\n\n## Installation\n\nWe use conda to release pclpy. To install, use this command:\n\n`conda install -c conda-forge -c davidcaron pclpy`\n\nDon't forget to add both channels, or else conda won't be able to find all dependencies.\n\n**Windows**: python **3.6** and **3.7** are supported\n\n**Linux**: python **3.6**, **3.7** and **3.8** are supported\n\n\n## Features\n\n- Most point types are implemented (those specified by `PCL_ONLY_CORE_POINT_TYPES` in PCL)\n- You can get a numpy view of point cloud data using python properties (e.g. `cloud.x` or `cloud.xyz`)\n- boost::shared_ptr is handled by pybind11 so it's completely abstracted at the python level\n- laspy integration for reading/writing las files\n\n## Example\n\nYou can use either a high level, more pythonic api, or the wrapper over the PCL api.\nThe wrapper is meant to be as close as possible to the original PCL C++ api.\n\nHere is how you would use the library to process Moving Least Squares.\nSee the PCL documentation: http://pointclouds.org/documentation/tutorials/resampling.php\n\nUsing the higher level api:\n\n```python\nimport pclpy\n\n# read a las file\npoint_cloud = pclpy.read(\"street.las\", \"PointXYZRGBA\")\n# compute mls\noutput = point_cloud.moving_least_squares(search_radius=0.05, compute_normals=True, num_threads=8)\n```\n\nOr the wrapper over the PCL api:\n\n```python\nimport pclpy\nfrom pclpy import pcl\n\npoint_cloud = pclpy.read(\"street.las\", \"PointXYZRGBA\")\nmls = pcl.surface.MovingLeastSquaresOMP.PointXYZRGBA_PointNormal()\ntree = pcl.search.KdTree.PointXYZRGBA()\nmls.setSearchRadius(0.05)\nmls.setPolynomialFit(False)\nmls.setNumberOfThreads(12)\nmls.setInputCloud(point_cloud)\nmls.setSearchMethod(tree)\nmls.setComputeNormals(True)\noutput = pcl.PointCloud.PointNormal()\nmls.process(output)\n```\n\nYou can see the wrapper is very close to the C++ version:\n\n``` c++\n// C++ version\n\npcl::PointCloud\u003cpcl::PointXYZ\u003e::Ptr point_cloud (new pcl::PointCloud\u003cpcl::PointXYZ\u003e ());\npcl::io::loadPCDFile (\"bunny.pcd\", *point_cloud);\npcl::MovingLeastSquaresOMP\u003cpcl::PointXYZ, pcl::PointNormal\u003e mls;\npcl::search::KdTree\u003cpcl::PointXYZ\u003e::Ptr tree (new pcl::search::KdTree\u003cpcl::PointXYZ\u003e);\nmls.setSearchRadius (0.05);\nmls.setPolynomialFit (false);\nmls.setNumberOfThreads (12);\nmls.setInputCloud (point_cloud);\nmls.setSearchMethod (tree);\nmls.setComputeNormals (true);\npcl::PointCloud\u003cpcl::PointNormal\u003e output;\nmls.process (output);\n```\n\n## Modules\n- 2d\n- common\n- geometry\n- features\n- filters\n- io (meshes are not implemented)\n- kdtree\n- keypoints\n- octree\n- recognition\n- sample_consensus\n- search\n- segmentation\n- stereo\n- surface\n- tracking\n#### These modules are skipped for now\n- ml\n- people\n- outofcore\n- registration\n- visualization\n- every module not in the PCL Windows release (gpu, cuda, etc.)\n\n## Not Implemented\n(see [github issues](https://github.com/davidcaron/pclpy/issues)\nand the _what to skip_ section in `generators/config.py`)\n\n## Building\n\nBuild scripts are in the `scripts` folder.\n\n1. Create your conda environment:\n    `conda env create -n pclpy -f environment.yml`\n\n2. Activate your environment:\n    `conda activate pclpy`\n\n3. Install development dependencies:\n    `pip install -r requirements-dev.txt`\n\n4. Download a copy of PCL\n    Windows: `powershell scripts\\download_pcl.ps1`\n    Linux: `scripts\\download_pcl.sh`\n\n5. Generate pybind11 bindings\n    Windows: `powershell scripts\\generate_points_and_bindings.ps1`\n    Linux: `scripts\\generate_points_and_bindings.sh`\n\n6. For development, build inplace using python\n    `python setup.py build_ext -i`\n    \n    For a release, use the scripts/conda_build.bat (or conda_build.sh) script\n\nOn Windows, these setup.py arguments can cpeed up the build:\n    - --msvc-mp-build enables a multiprocessed build\n    - --msvc-no-code-link makes the linking step faster (not meant for releases)\n    - --use-clcache to cache msvc builds (clcache must be installed)\n\n## Roadmap\n- Wrap as much of PCL as reasonably possible\n- More tests\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidcaron%2Fpclpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidcaron%2Fpclpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidcaron%2Fpclpy/lists"}