Playing Kinect games is a really great experience. Programming for Kinect is even greater! Browsing the web, you can find many cool "hacks" (CLNUI, OpenKinect) which allow Kinect be used by a PC rather than an XBOX. Via these hacks, we gain access to Kinect's cameras (color and depth), LED, accelerometer and motor. Obtaining both the raw and the depth image, it is easier to build Machine Vision applications. But the main problem remains: Kinect magic is its software and the device simply cannot give us all those body-tracking algorithms by itself.
Fortunately, PrimeSense, the company behind Kinect, released OpenNI framework and NITE middleware. This means that we can now have access to features such as real-time skeleton tracking, gesture recognition, wave detection and much more!
OpenNI and NITE installation can be painful if not done properly. Let's do it step by step:
Uninstall any previews drivers, such as CLNUI. Look at the end of this post if you want to see how you can have multiple drivers installed.
Drivers are now installed in your PC.
Download and install the latest stable or unstable OpenNI Binaries from OpenNI website.
Download and install the latest stable or unstable OpenNI Compliant Middleware Binaries (NITE) from OpenNI website.
During installation, provide the following (free) PrimeSense key: 0KOIk2JeIBYClPWVnMoRKn5cdY4=
Download and install the latest stable or unstable OpenNI Compliant Hardware Binaries from OpenNI website.
Both stable and unstable releases have worked for me. If you have trouble installing the unstable releases, just try the stable ones.
Navigate to C:\Program Files\OpenNI\Samples\Bin\Release (or C:\Program Files (x86)\OpenNI\Samples\Bin\Release) and try out the existing demo applications. Try the demos found in C:\Program Files\Prime Sense\NITE\Samples\Bin\Release (or C:\Program Files (x86)\Prime Sense\NITE\Samples\Bin\Release), too. If they work properly, then you are done! Congratulations!
If they do not work, make sure that you have replaced the XML files I mentioned in step 5 with the ones I provided you. If the demos still do not work, try installing the stable version of OpenNI, middleware and hardware binaries. Personally, I have successfully installed OpenNI and NITE (both stable and unstable releases) in a 32-bit desktop and a 64-bit laptop following the methodology I described.
You have successfully installed Kinect in your Windows PC! Read the documentation and familiarize yourself with the OpenNI and NITE API. You'll find the proper assemblies in:
OpenNI is the primary assembly you'll need when developing Natural User Interfaces applications.
C# tutorials on using the managed OpenNI.net libraries can be found in this blog, so stay tuned ;-).
If you have followed the above guide and still have trouble viewing the demos, then try out the following:
Thanks to my friend George Karakatsiotis (@erevodifwntas), you can now have various Kinect drivers installed concurrently. Here's how to achieve this:
Hi, thank you for the tutorial. I followed it step by step, however, I am not able tu run the sampes. In NiViewer.exe, I get error: A timeout has occured when waiting for new data!
I was able to compile NiVewer using VS2010, I am running on Windows 7. Any ideas how to fix it?
I was getting the same error when I had not properly configured the three XML files, so make sure that you use the ones I provide. If the error remains:
- Try to omit step 1 or
- Install the stable release only.
Did you manage to run the recompiled project and got the same error?
Honestly, that is an absurd number of steps to go through to install these drivers. I'm surprised no one has created a unified installer yet. Maybe it is best to wait for the official Microsoft drivers, which aren't too far away.
Yeah, the official drivers release would be ideal. But, currently, that's the best way we have to use Kinect's great capabilities.
Hey thx for the tut! But i cant get no picture! There is just a black screen... I tried it 3 times!
Which demo did you launch? Were any error messages displayed?
Thanks here too, great tutorial.
I got the same problem as pat, every program I use start up like it shoud be. But I cant see myself or anything. No errors too. With the C:\Program Files\Prime Sense\NITE\Samples\Bin\Release\Sample-StickFigure.exe. I just see a scene with nothing in it. The IR-Beam is working correctly too.... I am working with WinXP.
Hey Pat and Mitrous,
I had the same problem with the blank screen. I tried an experiment that worked for me: I ran the SensorKinect installer again. Maybe there is a fight between the PrimeSense (non-Kinect) driver package and the Kinect-specific version.
(Also, Vangos, I wasn't able to successfully run the current complied SensorKinect binary installer on my system, though I did have success using an older version that I found archived on someon's blog) (and also I think I now know how to just install the drivers directly).
Thank you everyone for your feedback. I really appreciate it.
@Tom, thanks for commenting. Here are SensorKinect releases: github.com/.../unstable. The latest one worked for me in both 32 and 64-bit computers.
Here is another solution you may try if the tutorial does not work for you:
- Omit step 1.
- Install OpenNI.
- Navigate to C:\Program Files\OpenNI\Driver and install dpinst-x86 or dpinst-amd4.exe.
- Install NIITE and replace the XML files.
Also, make sure that you install stable or unstable releases (eg, I would not recommend installing OpenNI unstable and NITE stable, although it might work for someone).
I don't know if what you say above will work (which apparently indicates not installing modded "SensorKinect" drivers) but I will tell you what just worked for me on my laptop (which had also had the blank screen issue):
Eradicate all traces of all PrimeSense and OpenNI drivers
install SensorKinect drivers
replace XML files
In other words, I followed your original steps, except I did the SensorKinect hardware layer installation (your original step 1) last, and I left out your step 4 (or rather replaced it with step 1).
The SensorKinect drivers are modded versions of the OpenNI hardware drivers. Makes sense that you wouldn't want to be intalling them over top of each other.
I tried all the steps, with the latest unstable builds for all and I have a x64 processor. The Device Manager looks the same, but I get an error whent rying to load the openNI samples:
Error: One or more of the following nodes could not be enumerated:
Device: PrimeSense/Sensorv2/184.108.40.206: The device is not connected!
Try to run SensorKinect-Win32-5.0.0.exe (in the bin folder) of the SensorKinect driver (rather than run dpinst-x86.exe). This is how I solved the
"Error: One or more of the following nodes could not be enumerated:
Device: PrimeSense/Sensorv2/220.127.116.11: The device is not connected!"
Thanks Erevodifwntas. I accidently did this step by following the guide:
github.com/.../README How do I get started using the functionality? I downloaded openNI unity sample, now I need to know what kind of information I can get? Like how do I detect poses and such. Could someone point me in the right direction? Should I be looking at avin2 for the functionality I get use, or OpenNI?
Excellent blog post, really helped me out. I was having difficultly installing OpenNI with unstable builds, now I know that the order of installation is very important. Thanks.
How are you C# tutorials coming along, I can't wait to read them, will you do anything on head tracking? I want to track user's head positions and redraw a 3D scene from their perspectives.
Thanks for your comment, Mark.
I am planning to publish some posts about Kinect and WPF (getting raw and depth image, body tracking, painting using gestures, etc). Head tracking sounds interesting.
I had some head tracking demos using OpenCV, so porting them to use Kinect might be a quite nice idea.
Powered by Zimbra