Pointcloud Playback Research

I’ve been researching different solutions for recording and playing back point clouds from the kinect camera.
One file format of interest is a .oni file, which wraps the depth image and rgb image from the kinect into one file.
This is exceptionally convenient and inconvenient for a number of reasons. Convenient because the file size is small and two files are wrapped into one, reducing redundancy and allowing a user to keep their assets in one place. Inconvenient because its a proprietary format that is not common to just about any piece of software except those with OpenNI in mind.

The first challenge was to produce a .oni file, which is accomplished by using openNI, of which you have to properly install.
Installation of OpenNI is a challenge in itself for anyone new to Command Line, and different versions of OpenNI install in different ways.

I found a lot of helpful links while rummaging through the depths of the internet tundra, here are some which I will go into more detail with when I have the time. I’ve decided to copy and paste content from the links I’ve found in an effort to consolidate everything into one place, in addition to preserving the documentation should any of the links become 404 not found.

Here’s how I go the samples working. First install OpenNI itself:

Download OpenNI 2.2 Beta for OS X.
Run sudo ./install.sh. You will not see any output. This is normal.
Next you’ll need a driver for the Kinect:

Clone the OpenNI2-FreenectDriver repo.
Run ./waf configure build. You should now have a build directory with libFreenectDriver.dylib in it.
Copy that file into Redist/OpenNI2/Drivers/. If you want to try the samples then also copy the file into Samples/Bin/OpenNI2/Drivers.
To run an example:

cd Samples/Bin
To use the OpenNI in an XCode project, for example in combination with openFrameworks:

Create a new project. (Use the project generator if you are working with oF.)
Click the name of the project in the left sidebar and make sure ‘Project’ is selected in the main panel.
Look for the setting ‘Header Search Paths’ and click to edit. Click the plus sign and add the path to ‘Include’ directory from OpenNI. For example, I installed OpenNI in /Applications/OpenNI-MacOSX-x64-2.2, so my path is /Applications/OpenNI-MacOSX-x64-2.2/Include.
Next, copy libOpenNI2.dylib from the OpenNI Redist folder to the folder that will contain your binary (the compiled version of your project). If you are working with oF then this is the bin folder inside your project.
Finally, add #include “OpenNI.h” add the start of your code. (In oF: this would be in testApp.h.)

Comments 1

Leave a Reply

Your email address will not be published. Required fields are marked *