Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Cant open capture object for Kinect

I have installed OpenNI and SensorKinect following the tutorial here: and the example viewer works just fine. I have downloaded OpenCV 2.4.3 and then done the following:

  1. mkdir release
  2. cd release
  3. cmake-gui ..
  4. hit configure
  5. set WITH_OPENNI to ticked
  6. checked that it has found OPENNI dirs and primesense dir
  7. hit configure and then generate
  8. ran make

I then try and run the sample code from OpenCV-2.4.3/samples/openni_capture.cpp

However I get the following output:

Device opening ...
done.
Can not open a capture object.

The relevant code is:

VideoCapture capture(CV_CAP_OPENNI);
if( isVideoReading )
    capture.open( filename );
else
    capture.open( CV_CAP_OPENNI );

cout << "done." << endl;

if( !capture.isOpened() )
{
    cout << "Can not open a capture object." << endl;
    return -1;
}