OpenNI is a library that provides support to capture color and depth images from cameras like Kinect and Primesense.
To build OpenCV with OpenNI support:
$ sudo apt install libopenni-dev $ sudo apt install libopenni-sensor-primesense-dev
-D WITH_OPENNI=ONto the CMake compilation string used in OpenCV compilation.
Tried with: OpenCV 2.4.9, OpenNI unstable 126.96.36.199 and Ubuntu 14.04 LTS