Start programming Kinect application using OpenNI

16,497

First of all, if you're planning to use OpenNI with Kinect, I advise you not to use version 2.0, which is available at the official website. The reason is simply that there currently is no driver yet to support the Microsoft Kinect (the company behind OpenNI - PrimeSense - only supports a driver for their own sensor, which is different from the Kinect, and the community hasn't gotten round to writing a Kinect driver yet).

Instead grab the package from the simple-openni project's downloads page - it contains everything to get you going: libraries from the 1.5.x line.

  • OpenNI is the barebone framework - it only contains the architecture for natural interface data processing.
  • NITE is a proprietary (freeware) library by PrimeSense that provides code to process the raw depth images into meaningful data - hand tracking, skeleton tracking etc.
  • SensorKinect is the community-maintained driver for making the Kinect interact with OpenNI.

Mind you that these drivers don't provide a way to control the Kinect's tilt motor and the LED light. You may need to use libfreenect for that.

As for getting started, both the OpenNI and NITE packages contain source code samples for simple demos of the technology. It's a good idea to start with one and modify it to suit your needs. That's what I've done to get my own project - controlling Google Chrome with Kinect - working.

As for learning C++, there are tons of materials out there. I recommend the book "Thinking in C++" by Bruce Eckel, if you're a technical person.

Share:
16,497
Cherple
Author by

Cherple

Updated on June 13, 2022

Comments

  • Cherple
    Cherple about 2 years

    I'm about to start my final year project which requires me to develop the Kinect Fusion Algorithm. I was told to code in C++ and use the OpenNI API.

    Problem:

    • I read up online but I am still confused as to how to start. I installed Microsoft Visual Studio 2012 Express as well as OpenNI, but how should I start? (I was told to practice coding first before starting to work on the project)
    • If I want to practice and understand how the codes work and how the Kinect respond to the code, any advice on how should I start? As I am REALLY lost at the moment and hitting a dead end, not knowing what to do next with many of the information online which I do not really understand.
  • IneQuation
    IneQuation over 11 years
    The problem with the current version of OpenNI is that it doesn't have a Kinect driver yet. So unless you have a sensor from PrimeSense, it's pretty much useless right now.
  • Nicholas Pappas
    Nicholas Pappas over 11 years
    Is that the 2.0 or 2.1 (or both) driver set?
  • IneQuation
    IneQuation over 11 years
    Both, at least that was the situation about a month ago, when I started working on my project. I was forced to dig through the internet to find archived versions of packages that actually worked with the Microsoft device - that's how I found that simple-openni project.
  • Cherple
    Cherple over 11 years
    Wow.. That looks extremely useful.. hmm.. Pardon me but i have a very simple and stupid question.. How to i really start? lol.. Do i just run the source codes in Microsoft Visual Studio? Or? I'm really sorry.. I just can't seem to understand.. I'm too used to programming and viewing output in the command prompt view.. So how can i modify codes and where/how do i view the output?
  • IneQuation
    IneQuation over 11 years
    Yeah, as far as I remember the samples have Visual Studio project files with them. Just double click the .sln or .vcxproj file.
  • Cherple
    Cherple over 11 years
    There are 2 files inside one of the samples folder.. 'NiSimpleCreate_2008' and 'NiSimpleCreate_2010'. When i tried opening the .vcproj file using my Microsoft Visual Studio Express 2012 for Desktop, i received errors. "NiSimpleCreate_2010: Error creating backup directory: C:\Program Files\OpenNI\Samples\NiSimpleCreate\Backup"
  • IneQuation
    IneQuation over 11 years
    Refer to the Visual Studio manual. Don't get me wrong, I'm not here to teach you how to use MSVS.