In the previous section we saw how to install OpenNI, NITE and the SensorKinect drivers on Windows and we tried the given samples like this:
(IR and RGB video)
Now we are going to take advantage of information provided by OpenNI and by the Kinect to make skeleton tracking.
Before starting we will need of OSCeleton which is an open-source proxy . It collects the skeleton information returned by the Kinect (via the OpenNI interface) and then format them in a standard format before sending them via OSC (Open Sound Control). This simplifies the use of data to make them available in any programming language/application which supports the OSC protocol:
- To start download OSCeleton here (if you don’t have a git client click on Downloads > Download.zip).
- Extract the zip file contents, browse into the folder and open OSCeleton.sln with Visual Studio C++ express 2010 (If you didn’t it, download it here).
- Once the project opened, generate the executable by pressing the F6 key or by clicking on Build Solution from the Build menu.
- After close Visual Studio, browse into the Debug folder which has just been created to check out if OSCeleton.exe has been generated.
- Finally verify that it was properly compiled by running the executable with the -h option to display all the available options: OSCeleton.exe –h.
Now that OSCeleton is installed, we are going to download the examples to make some tests:
- First download the examples provided at this address: https://github.com/Sensebloom/OSCeleton-examples (Downloads > Download.zip).
- Once the download is completed, expand the archive.
These examples use two free open source software which are Animata and Processing. Animata is a software for real-time animation designed to create animations and interactive background that are similar to an environment of puppets. Processing is itself a development environment and programming language designed to easily create images, animations or interactions.
Let’s start by testing the example with Animata:
- If you don’t have it, download Animata here (version 004) and expand the zip file.
- Then run OSCeleton with these options: OSCeleton.exe -k -mx 640 -my 480 -ox -160. The –k option (« kitchen » mode) allows to format the messages sent by OSC to make them compatible with Animata.
- Later runs Animata and open the “doll_soft.nmt” example which is located in the animata folder.
(That’s what you should see on your screen)
- Take place in front of your Kinect, and put yourself in position calibration as shown above.
- When calibration is done, the animata should begin to replicate your movements.
In order to have a little more freedom, we are going to test the examples under Processing:
- If you don’t have Processing, download it here (1.2.1 version). Once downloaded and run it and close it. This will create a lot of configuration files and create a folder named Processing in your Documents.
- To run the examples you will need 2 libraries:
- OscP5 is a library which implements the OSC protocol. If you don’t have it, download it using SVN here (If you don’t have a SVN client, download TortoiseSVN).
- pBox2d is a physics engine for 2-dimensional worlds. You can download it here (currently v0.03).
- To use these libraries in Processing copy them into the Processing>libraries folder in your documents.
- Run OSCeleton without argument.
- Restart Processing if it was open, otherwise run it.
- Select Open in the File menu and select the MotionCapture3D.pde sample in the example folder that we have previously downloaded.
- Run the example by going to the Sketch>Run menu.
- Put yourself in front of the Kinect and wait until the calibration is done. Then you must see your skeleton in the Processing window as shown above.
There is also an OpenNIs wrapper for Processing which allows you to access more features such as the depthMap, the handtracking, etc… This library is called Simple-OpenNI-and you can download it here. Install it in the same way as OscP5 and pBox2d by expanding the archive into the Processing>libraries folder in your Documents.
Well, now you have all the basis to start the development of prototypes using Kinect while pending the official SDK from Microsoft release.