/PyOpenNI2

Python bindings for the OpenNI2 library.

Primary LanguageC++BSD 2-Clause "Simplified" LicenseBSD-2-Clause

PyOpenNI, round II

Note: Not usable yet. Work is being done in the unstable branch,
post your Pull Requests there. Don't report issues of the master branch!


Yep, you guessed it, these are the fantastic, incredible OpenNI2 bindings for the Python scripting language.

This is a follow-up to PyOpenNI, which binded the (now legacy) OpenNI1; this has been rewritten from scratch and uses Python's recommended way af building, Distutils, instead of CMake. This makes PyOpenNI2 really easy to install, see Installing.

Boost::Python is the way to go with OpenNI2, which is a C++ API (in contrast to OpenNI1, which was a C API). 99% of the wrapper is contained in a single file, wrapper.cc.

Important: OpenNI2 no longer provides an API to access middleware, see the migration guide. That means you need another binding to access NITE, for example. You can find middleware binding on [the wiki page] (https://github.com/jmendeth/PyOpenNI2/wiki/Middleware_Bindings).

PyOpenNI2 is made available under a [2-clause BSD license] (http://opensource.org/licenses/BSD-2-Clause), see LICENSE.
Feedback? Problems? Want a feature? Did I chose an original name?
File an issue or pull-request.

Installing

Tip: You may find instructions for your own platform on [the wiki] (https://github.com/jmendeth/PyOpenNI2/wiki); if not, you can follow these.

You'll need:

  • Python (of course) and its development files.
  • OpenNI2 (the latest stable release should work). You can download ready-to-use binaries at the website. Don't forget to run sudo ./install.sh!
  • Boost::Python, and its development files. If it's in a non-standard location, you may need to tweak setup.py.

Now, just run the usual command:

$ sudo -E python setup.py install

For more information about installing Python modules, look here.

I have a problem in Windows that...

No. Windows is like the different one, and it's by design. Every other system follows the standards. I don't care supporting it (well, others may) because Microsoft hasn't made a single action to support us as developers.

After that mini-rant, left to say is that you should switch to another OS, like Linux (it's worth the change), or try searching for people having the same problem, installing MinGW, or file an issue. But in the latter, don't expect much support. What's more, the whole distutils doesn't support Windows.

Usage

Once it's installed, just import it:

import openni2

Some documentation is available via docstrings, viewable with Python's own help system, but there's still a lot missing.

help(openni2)
help(openni2.Device)
help(openni2.Device.has_sensor)

Also take a look at the examples directory.