OpenNI
OpenNI
Desktop applications
Details:
Not VEX-supported
Object and motion detection
Kinect video acquisition
GPU/OpenCL support
OpenNI (Open Natural Interaction Library) is a library of programming functions mainly aimed at interacting with 3D input devices like the Microsoft Kinect, developed by PrimeSense. It is free for use under the open source Apache license. The library is cross-platform, and focuses mainly on interaction with "natural input" devices such as the human recognition features of the Kinect. Unlike OpenCV, OpenNI does not have image processing capabilities and is mostly a framework for retrieving data and performing skeletal tracking.
While it is true that OpenNI 2 has been released at this point, they continue to support only the official Microsoft Kinect SDK. For the time being OpenNI 1.X will be the preferred SDK for use on Linux systems.
Compatibility
OpenNI was designed to run on personal computers, but its algorithms perform acceptably on both ODROID-XU.
Installation
These instructions assume a Debian-based Linux system.
Install all these packages:
Create the folder kinect in a writable location, such as the user home directory.
Change to this folder and type:
to get the latest version of OpenNI (this should not take too long)
Edit Platform/Linux/Build/Common/Platform.Arm and remove all instances of -mfloat-abi to switch to hard float mode
Execute:
If it breaks on a "-j0" problem, change it to "-j4" inside Redist_OpenNI.py
Install OpenNI (the version number may change):
Get the Kinect drivers:
Once again, get rid of the software floating point flags in Platform/Linux/Build/Common/Platform.arm by removing all instances of -mfloat-abi
Compile the Kinect drivers (the version number may change):
Fix the USB drivers by editing Config/GlobalDefaultsKinect.ini and changing ;UsbInterface=2 to UsbInterface=1
Install the USB drivers:
Add yourself to the video group (replace username with your user name, requires reboot to take effect):
Usage
Initially, OpenNI 1.0 showed great promise, as it efficiently retrieved depth and color images from an attached Kinect using the provided sample code. The nightmarish documentation, however, dissuaded development. OpenNI 2.0 seemed to be a great improvement with its better code structure, but the Kinect drivers were removed and placed in the separate libfreenect driver. These two pieces of code did not work well together, causing USB errors, missing depth images, and horrible problems with exposure control.
Ultimately, discontinuing the use of OpenNI altogether and switching to a C-only API with libfreenect directly worked much better. A library call could be used to disable automatic exposure, performance increased, and USB errors largely vanished.
Teams Contributed to this Article:
BLRS (Purdue SIGBots)
Last updated