openNI interferes with cvCreateCameraCapture()
Question
I am using opencv 2.3 on ubuntu 11.04. while compiling, for completeness, I'd set WITH_OPENNI=ON. (regret it now, because I dont plan to use a kinect soon, and openni is giving me headaches with normal opencv programs)
anyway, to test the opencv installation i compiled following code that shows me video from my laptop webcam:
#include <stdio.h>
#include <string.h>
#include "highgui.h"
#include "cv.h"
int main()
{
cvNamedWindow("Webcam",CV_WINDOW_AUTOSIZE);
CvCapture* capture=cvCaptureFromCAM(0);
IplImage* frame;
while(1)
{
frame=cvQueryFrame(capture);
if(!frame) break;
cvShowImage("Webcam",frame);
char c=cvWaitKey(33);
if(c==27) break;
}
cvReleaseCapture(&capture);
cvDestroyWindow("Webcam");
}
the code complies correctly but gives the following error on execution:
OpenCV Error: Unspecified error (Failed to enumerate production trees: Can't create any node of the requested type!) in CvCapture_OpenNI, file /home/samarth/OpenCV-2.3.0/modules/highgui/src/cap_openni.cpp, line 188 terminate called after throwing an instance of 'cv::Exception' what(): /home/samarth/OpenCV-2.3.0/modules/highgui/src/cap_openni.cpp:188: error: (-2) Failed to enumerate production trees: Can't create any node of the requested type! in function CvCapture_OpenNI
Aborted
has anybody faced the same problem? any idea to cure this would be highly appreciated.
Solution
This problem was fixed in OpenCV 2.3.1 release.
See following link for the details: https://code.ros.org/trac/opencv/ticket/1237