OpenNI2 + NiTE2 + freenect + Ubuntu 13.04 + Kinect 1473 + OpenCV

Step 0: Dependencies

Install the following packages:

sudo apt-get install cmake git libusb-dev freeglut3-dev pkg-config build-essential libxmu-dev libxi-dev libusb-1.0-0-dev libgtk2.0-dev python-dev python-numpy libavcodec-dev libavformat-dev libswscale-dev 

Step 1: libFreeNect, the device driver for Kinect

Get libfreenect

Clone it. Then follow instructions on their wiki page to install:

Be sure to set libfreenect into the LD_LIBRARY_PATH. What I did was adding the line below into my ~/.bashrc
export LD_LIBRARY_PATH=/home/forrest/libfreenect/build/lib/

Step 2: OpenNI2, the software foundation

Get OpenNI2 at and install by executing the script You have to be root/sudo to do that.

Copy OpenNI2-FreenectDriver/build/ to OpenNI-Linux-x64-2.2/Samples/Bin/OpenNI2/Drivers/ and OpenNI-Linux-x64-2.2/Redist/OpenNI2/Drivers/ .

Step 3: NiTE2, the PrimeSense middleware that calculates the skeleton

Download it from You will be asked to register or log in before you can download. After downloading, extract the files and run the as root/sudo.

Copy OpenNI2-FreenectDriver/build/ to NiTE-Linux-x64-2.2/Samples/Bin/OpenNI2/Drivers/ .

Now, run the test app UserViewer under NiTE-Linux-x64-2.2/Samples/Bin/ to see whether you can get your skeleton extracted.

Step 5: OpenCV

Option 1: Using apt-get

sudo apt-get install libopencv-dev

It will install all needed packages for you.

Option 2: Compiling from source

Download OpenCV from and follow instructions at

You do not have to set CMAKE_INSTALL_PREFIX as /usr/local. It can be any where other than the directory where you will run make.

Also, do not forget to append LD_LIBRARY_PATH with installed OpenCV's lib.

This link might help:


If you get OpenNI initialization failure error like this:, make sure that you have (the bridge between OpenNI2 and libfreenect, NOT libfreenect itself) in place and is pointed by LD_LIBRARY_PATH


Unknown said...

"LD_LIBRARY_PATH" and you just saved me. Thank you !

Unknown said...

"LD_LIBRARY_PATH" and you just saved me. Thank you ! :)

V. Margot said...

Any idea on where to get NiTE2 now that is dead (thanks Apple)?

(for can get OpenNI2 from github, just search google)

Anonymous said...

I found it here: