Giter Site home page Giter Site logo

wkentaro / python-pcl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from strawlab/python-pcl

1.0 3.0 0.0 1.88 MB

Python bindings to the pointcloud library (pcl)

Home Page: http://strawlab.github.com/python-pcl/

License: Other

Makefile 0.87% Python 94.78% C++ 3.31% C 1.04%

python-pcl's Introduction

Fork me on GitHub

Introduction

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")

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 work was supported by Strawlab.

Requirements

This release has been tested on Linux Mint 17 with

  • Python 2.7.6
  • pcl 1.7.2
  • Cython 0.21.2

and CentOS 6.5 with

  • Python 2.6.6
  • pcl 1.6.0
  • Cython 0.21

A note about types

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.

API Documentation

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.

pcl

python-pcl's People

Contributors

nzjrs avatar larsmans avatar psporysz avatar astraw avatar ccordoba12 avatar colincsl avatar jabooth avatar chrisidefix avatar blootsvoets avatar chriswl avatar

Stargazers

PEP 8 Speaks avatar

Watchers

James Cloos avatar Kentaro Wada avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.