Python Integration with OpenNI

OpenNI is a software development kit that works with Microsoft Kinect and Primesense.  It supports body and hand gesture recognition and tracking.  Python integration with OpenNI is done through PyOpenNI.

Download PyOpenNI

$ git clone

Download NiTE

$ cd ~/Download
$ wget
$ cd lib/NITE-Bin-Dev-Linux-x64-v1.5.2.21/
$ chmod a+x
$ sudo ./

Build PyOpenNI

$ mkdir build; cd build
$ cmake ..
$ make

Install PyOpenNI

To install it, simply copying to one of the Python library locations, such as below:

$ sudo cp -fR lib/ /usr/local/lib/python2.7/dist-packages

Make sure PYTHONPATH contains the above location.

Run PyOpenNI

$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import openni

If you run into any issue indicating missing openni-dev, it is likely cased by this bug. Simply edit pcl_io-1.7.pc and replace openni-dev with libopenni, like below:

Requires:  eigen3 libopenni pcl_common-1.7 pcl_octree-1.7


With PyOpenNI working, we can run some cool demos.  Cecila Cinta gave a talk and provided a set of demos.  However, the demo python files are in ipython notebook format.  To convert, first download ipython, and nbconvert:

$ sudo pip install ipython
$ sudo pip install "ipython[notbook]"

Then convert them like this:

$ ipython nbconvert --to python "Hand and Gesture Tracking.ipynb"

Run the hand and gesture tracking demo you will get the video below:

Run the body tracking demo you will get this: