1 Star 0 Fork 0

TF-boy/python-pcl

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
BSD-3-Clause
Fork me on GitHub

Introduction

This is a small python binding to the [pointcloud](http://pointclouds.org/) 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 Ubuntu 14.04 with

  • Python 2.7.6, 3.4.0, 3.5.2
  • pcl 1.7.0
  • Cython <= 0.25.2

and MacOS with

  • Python 2.7.6, 3.4.0, 3.5.2
  • pcl 1.8.1(use homebrew)
  • Cython <= 0.25.2

and Windows with

  • (Miniconda/Anaconda) - Python 3.4
  • pcl 1.6.0(VS2010)
  • Cython <= 0.25.2
  • Gtk+

and Windows with

  • (Miniconda/Anaconda) - Python 3.5
  • pcl 1.8.1(VS2015)
  • Cython <= 0.25.2
  • Gtk+

Installation

Linux(Ubuntu)

before Install module

PCL 1.7.0 and Ubuntu14.04 (use apt-get)

  1. Install PCL Module.
sudo add-apt-repository ppa:v-launchpad-jochen-sprickerhof-de/pcl -y

sudo apt-get update -y

sudo apt-get install libpcl-all -y

PCL 1.7.2 and Ubuntu16.04 (use Debian package)

  1. Install PCL Module.?
sudo apt-get update -y

sudo apt-get install build-essential devscripts

dget -u https://launchpad.net/ubuntu/+archive/primary/+files/pcl_1.7.2-14ubuntu1.16.04.1.dsc

cd pcl-1.7.2

sudo dpkg-buildpackage -r -uc -b

sudo dpkg -i pcl_*.deb

* current add ppa
  (sudo add-apt-repository -remove ppa:v-launchpad-jochen-sprickerhof-de/pcl -y)

Reference `here <https://launchpad.net/ubuntu/xenial/+package/pcl-tools>`_.

PCL 1.8.0 and Ubuntu16.04(build module)([CI Test Timeout])

  1. Build Module

    Reference here.

MacOSX

before Install module

Case1. use homebrew(PCL 1.8.1 - 2017/11/13 current)

  1. Install PCL Module.

    brew tap homebrew/science

    brew install pcl

Warning:

Current Installer (2017/10/02) Not generated pcl-2d-1.8.pc file.(Issue #119)

Reference PointCloudLibrary Issue.

Pull qequests 1679.

Issue 1978.

circumvent:

copy travis/pcl-2d-1.8.pc file to /usr/local/lib/pkgconfig folder.

Windows

before Install module

Case1. use PCL 1.6.0

Windows SDK 7.1

            PCL All-In-One Installer

            32 bit

64 bit

OpenNI2[(PCL Install FolderPath)\3rdParty\OpenNI\OpenNI-(win32/x64)-1.3.2-Dev.msi]

Case2. use 1.8.1

            Visual Studio 2015 C++ Compiler Tools

            PCL All-In-One Installer

            32 bit

            64 bit

OpenNI2[(PCL Install FolderPath)\3rdParty\OpenNI2\OpenNI-Windows-(win32/x64)-2.2.msi]

        Common setting

Windows Gtk+ Download

Download file unzip. Copy bin Folder to pkg-config Folder

or execute powershell file [Install-GTKPlus.ps1].

Python Version use VisualStudio Compiler

set before Environment variable

  1. PCL_ROOT

    set PCL_ROOT=$(PCL Install FolderPath)

  2. PATH

    (pcl 1.6.0) set PATH=$(PCL_ROOT)/bin/;$(OPEN_NI_ROOT)/Tools;$(VTK_ROOT)/bin;%PATH%

    (pcl 1.8.1) set PATH=$(PCL_ROOT)/bin/;$(OPEN_NI2_ROOT)/Tools;$(VTK_ROOT)/bin;%PATH%

Common setting

  1. pip module install.
pip install --upgrade pip

pip install cython==0.25.2

pip install numpy
  1. instal python module
python setup.py build_ext -i

python setup.py install

Build & Test Status

windows(1.6.0/1.8.1)

https://ci.appveyor.com/api/projects/status/w52fee7j22q211cm/branch/master?svg=true

Mac OSX(1.8.1)/Ubuntu14.04(1.7.0)

https://travis-ci.org/strawlab/python-pcl.svg?branch=master

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

For deficiencies in this documentation, please consult the PCL API docs, and the PCL tutorials.

Copyright 2013 John Stowers, Strawlab Copyright 2015 Netherlands eScience Center All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * The names of the authors and contributors may be not used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

简介

目前最常用的python版PCL 展开 收起
BSD-3-Clause
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/TF-boy/python-pcl.git
git@gitee.com:TF-boy/python-pcl.git
TF-boy
python-pcl
python-pcl
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385