How to check OpenCV for Kinect support

In order to use the OpenCV interface to gain access to Kinect streams you build OpenCV from sources with the OpenNI option enabled. For this to work you first have to install the required drivers.

Once you build and install OpenCV with OpenNi support, you can check for a proper installation by looking at the output of
::cv::getBuildInformation()
you can do it with this code.

Check the generated output for the lines related to OpenNI, they should look like
OpenNI: YES (ver 1.5.7, build 10)
OpenNI PrimeSensor Modules: YES (/usr/lib/libXnCore.so)
otherwise you should check the OpenCV building process.

For reference check out the output I got in my machine.