Object and motion detection
Kinect video acquisition
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.
OpenNI was designed to run on personal computers, but its algorithms perform acceptably on both ODROID-XU.
These instructions assume a Debian-based Linux system.
Install all these packages:
lang=sudo apt-get install build-essential gcc-multilib libusb-1.0.0-dev git-core doxygen graphviz openjdk-7-jdk freeglut3-dev
Create the folder kinect in a writable location, such as the user home directory.
Change to this folder and type:
lang=git clone git://github.com/OpenNI/OpenNI.gitcd OpenNIgit checkout unstable
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
If it breaks on a "-j0" problem, change it to "-j4" inside Redist_OpenNI.py
Install OpenNI (the version number may change):
lang=cd ../Redist/OpenNI-Bin-Dev-Linux-Arm-v220.127.116.11sudo ./install.sh
Get the Kinect drivers:
lang=cd ../../../../git clone git://github.com/avin2/SensorKinect.gitcd SensorKinect
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):
lang=cd Platform/Linux/CreateRedist./RedistMakercd ../Redist/Sensor-Bin-Linux-Arm-v18.104.22.168
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):
lang=sudo adduser username video
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.
BLRS (Purdue SIGBots)