Getting the Kinect setup on your PC: OpenNI / Primesense

OpenNI-Kinect

Here’s the full details and process on getting your Kinect running on your PC using the OpenNI and Primesense drivers, yes this may be a little old news for some, but my guide here will actually get your Kinect running pretty much first time rather than leave you to guess and try to follow the other guides out there.

So first of all you’ll need a Kinect! Now we’ve sorted that out, the rest is easy and just a matter of following the steps – I’m documenting this as much for my own use as well as yours… I’m doing this for a Windows XP laptop, but you can do this on Ubuntu, Windows 7, Mac OSX etc…

1. Remove any existing drivers

First of all, if you have any drivers previously installed for the Kinect, such as OpenKinect, Freenect, Microsoft Kinect drivers etc… you’ll need to remove/ uninstall them. They will appear in the device manager under Human Interface and normally be called something like Xbox NUI Motor, Xbox NUI Camera, Xbox NUI Audio. Incidently when you install the OpenNI/ Primesense drivers, they are named differently and you do not want to under any circumstances use the above drivers.

2. Download and install the following drivers & binaries

download kinect sensor driver

Head on over to Github and get this package https://github.com/avin2/SensorKinect which you want to download that and then navigate to the Bin directory and install the relevant driver for your OS. This has the drivers precompiled for you but you can also compile this from source. The file will be something like:

  1. SensorKinect-Win-OpenSource32-5.0.3.4.msi

OpenNI downloads

Next, you’ll want to go to OpenNI.orgs download page and for each of the options select stable choose which development package you want for your OS:

  1. OpenNI Binaries
  2. OpenNI Compliant Middleware Binaries
  3. OpenNI Complient Hardware Binaries

You can also download & compile these from binaries by going to the OpenNI github page

So now you should have 3 files something like:

  1. openni-win32-1.3.3.6-dev.msi
  2. nite-win32-1.4.2.4-dev.msi
  3. sensor-win32-5.0.4.3-redist.msi

Or whatever you’ve compiled from Git, run the installs etc…

On the Primesense Nite installation, if prompted for a key, add the following:

0KOIk2JeIBYClPWVnMoRKn5cdY4=

Now that’s done you’ll need to download and install the Microsoft Visual C++ Redistributable Package for your OS which can be found at:

http://www.microsoft.com/download/en/search.aspx?q=Microsoft+Visual+C%2b%2b+2010+Redistributable+Package

In my instance I’m using the x86 one, for windows 7 use x64 etc… just grab the latest one available. This allows you to run the OpenNI applications.

3. Plug and pray

Now plugin the Kinect – make sure you have the power plugged in as well, not just the USB! Your computer should recognise the Kinect and want to install the drivers – make sure you choose the Primesense ones if prompted – I found that when I had old drivers it remembered the location, so I just zipped up the folder and archived it to remove it from the driver search.

Device manager after successful install

If all goes well you should have 3 hardware installation screens on Windows and the device manager should show the hardware under Primesense

4. Setup

Now that’s installed there are a few more things you need to do in order to hook up OpenNI and Primesense, namely a few XML config files which you just need to add in the same license key so that Primesense will work for you that key was:

0KOIk2JeIBYClPWVnMoRKn5cdY4=

Insert OpenNI key

Link OpenNI and Primesense

5. Finished

Now that’s done you can start to play around with the examples – there are various wrappers/ API’s available to you to now use this to create applications.

  1. Test out OpenNI by running the NiViewer sample
  2. Test out Primesense by running any of the samples there

Primesense sample

Now you have that installed you can move on to using various wrappers etc… to hook the Kinect up to Flash, Silverlight, Processing, Arduino, Java, Python etc…

5 Comments

  • Oh, thank you so much for this article! I finally need to get my hands on the Kinect sensor and having this really well documented process really helps.

    What are your plans with Kinect unless it’s top secret? :)

    • Well first of all I’m going to run it through Flash/ AS3 as that’s straight forward (kind of) – also I got a bit frustrated as no one in that community seems to share any code, just a video of it working, so I’ll post everything up :)

      I can then put Flash and Arduino together, or I may write a wrapper for Processing to pair up Kinect and Processing.

      There’s a few other different methods of connecting the hardware up out there so I’ll also document those

      • I got it working with Freenect and Mono C# a while ago but it was a real pain to set it up. I would like to get my hands on full body motion sensing and I think OpenNI enables it. That should be fun to try out and control some electronics! :)

        • I found with freenect that you can do depth sensing and blob detection and it allows control over the camera. The OpenNI gives you skeletal data, it’s a little slow in the framerate when you run it through another layer like Flash/ AS3. You can also do the same using a socket server such as node.js or if you’re fancy and have windows 7 and want to be closed off you can use Microsofts SDK :)

          I’ll be writing up more stuff this weekend…. soon it’ll be on the Arduino.. soon.

  • Larry, I seriously need your help… I’ve followed your guide step by step, installed all the software as you’ve mentioned and whenever I try to get NiViewer to work, I get an error stating that it cannot locate the XnDDK64.dll… Do you have any idea what I can do?

Join the Discussion

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>