Pages

Thursday 21 June 2012

Installation of OpenNI with NITE middleware for Microsoft Kinect

Update (31/03/2013): Since writing this blog post, there have been a number of updates to the OpenNI SDK. Now the framework is totally changed, and the links to the OpenNI and NITE binaries used in this tutorial have been moved to another location. You will need to download the specific version of binaries from the new links, rest of the installation process is still the same.

Okay, so this post is again a guide for installation of another library. This time it is OpenNI library for Microsoft Kinect. I am currently working on a computer vision project which utilizes the power of Microsoft Kinect's depth sensor. While researching for my project, I found out that OpenNI library is better than Kinect SDK in many ways. It is opensource, cross-platform, has skeletal as well as hand tracking (which I needed for my project), gesture recognition and ability to use OpenCV were many reasons for choosing OpenNI over Kinect SDK.

OpenNI contains the SDK to access RGB and Depth data from depth sensors containing primesense hardware which includes Microsoft Kinect. However to use skeletal tracking, hand tracking, gesture recognition or any other natural interaction functions in an application a natural interaction library called NITE is required. To use these libraries with Microsoft Kinect, drivers for using Kinect sensor with OpenNI and NITE are required. To install these libraries and drivers is the easiest part, however to make the sensor working with these libraries is really difficult. I followed a number of guides online, however I could not find any guide which could completly resolve all the problems which come after installation and make the sample programs work. I am writing this guide to make sure that most people get the sensor working with these open source libraries.


To make this guide simple, I will first of all explain the installation process. After this I will explain the settings/modifications required to make this installation up and running with Kinect sensor. This guide is for 16 bit installation and uses the latest unstable OpenNI and middleware binaries.

Installation Process:
If you are familiar with OpenNI structure then you might know that everything in these libraries is dependant on node based communication between software, hardware and application part. The installation process is also similar, we will install both software nodes and hardware nodes. To begin with first install OpenNI binaries.

Go to: OpenNI Download Page OpenNI SDK history page and download Unstable OpenNI binaries for windows(x86) OpenNI SDK v1.5.4.0 binaries for Windows-x32. Install these binaries with default folder and settings.
Next go to: SensorKinect Drivers Github and download the zip file. Extract to a folder and navigate to bin folder. Install the drivers using win32 installation package.

The last step to complete the installation process is to install the NITE middleware. To do this again go to OpenNI Download Page OpenNI SDK history page and download and install the unstable middleware binaries for win32  NiTE v1.5.2.21 binaries for Windows-x32.

Settings required for Microsoft Kinect Sensor
To set OpenNI to work with Microsoft Kinect sensor, we will have to replace few files with the files that corresponds to Kinect Sensor. To do this I assume that you have installed everything in the installation step to their default folders.

First of all go to the folder where you extracted the SensorKinect zip from SensorKinect Drivers Github. Inside this folder go to \OpenNI\Data and copy and replace the SamplesConfig.xml file to
C:\Program Files (x86)\OpenNI\Data
For the second step first download the XML files needed for Kinect from OpenNI Kinect XML and extract to a folder. Now inside this folder go to NITE folder and copy and replace the three files to
C:\Program Files (x86)\PrimeSense\NITE\Data
Thats it! You can now check if the installation was successful by running already compiled samples inside OpenNI and NITE folders.