OpenNI is not maintained anymore, and its official website was shutdown by 2014 following PrimeSense's acquisition by Apple. OpenNI and its associated middleware is no longer distributed, and as a result this module is no longer maintained. There is a fork called OpenNI 2 which is maintained here, but it's not compatible with this module.
- Implemented more features.
- Some capabilities are now exposed!
- Polymorphism on production nodes is handled correctly.
- Removed unnecessary
- Uses CMake, the popular cross-platform buildsystem, to configure & compile the bindings.
This way, it autodetects needed libraries and warns you if they're not found.
- Code cleanup and formatted according to PEP 8 rules.
- Directory structure simplified.
- Errors are handled gracefully through the class
- Re-wrote wrapper's core to make it more robust and avoid crashes.
- New! Access depth map efficiently! See the commit for details.
- Callbacks are now completely supported!
- Some exposed features are now documented in Python.
Note: Currently, not all features are being exposed to Python (see the status page). We are working to add more, but if you want to accelerate this process you're encouraged to collaborate. Contact me if you wish to help develop PyOpenNI. See the github page if you want to submit a bug or a feature request. Thanks!
Things you'll need:
- GIT to download
- OpenNI (latest unstable version: 126.96.36.199) and Python 2.7 or higher
- A compiler for your platform (GCC, XCode, VS, MinGW, ...)
Note: if you have installed Python via a package manager, you'll also need the development files, because sometimes the CPython API is used directly.
Via APT (if you are on Debian / Ubuntu):
sudo apt-get install cmake build-essential git-core \ python-dev libboost-python-dev
Then, assuming Git and CMake are installed and in your PATH:
git clone https://github.com/jmendeth/PyOpenNI.git mkdir PyOpenNI-build cd PyOpenNI-build cmake ../PyOpenNI # Build with your compiler
That's it! The finished module is at
lib/openni.<ext>; just copy it to your Python modules' directory.
To import the module:
and, if you prefer, you can also
from openni import *
so you don't have to type this annonying
openni. before the class names.
To get started, I suggest you to see the samples at the
And, to look at the documentation of PyOpenNI:
help(openni) #Help about the whole module help(openni.Context) #Help about a specific class help(openni.Context.init) #Help about a specific function