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.
$ git clone https://github.com/jmendeth/PyOpenNI.git
$ cd ~/Download $ wget https://simple-openni.googlecode.com/files/OpenNI_NITE_Installer-Linux64-0.27.zip $ cd lib/NITE-Bin-Dev-Linux-x64-v18.104.22.168/ $ chmod a+x install.sh $ sudo ./install.sh
$ mkdir build; cd build $ cmake .. $ make
To install it, simply copying to one of the Python library locations, such as below:
$ sudo cp -fR lib/openni.so /usr/local/lib/python2.7/dist-packages
PYTHONPATH contains the above location.
$ 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
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
$ 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: