Reputation: 11
I have a OpenCV project written with OpenCV 2.4.6 (Without OpenNI) in Visual studio 2012.
Project uses integrated webcam but now I want to use Kinect camera for RGB frames instead of webcam.
Currently I am writing following code:
VideoCapture capture(CV_CAP_OPENNI); // I have tried with capture(0), capture(1)
if(!(capture.isOpened())){
cout << "OPENCV:Cannot open the WebCamera" << endl;
return -1;
}
And result is that it's not able to open capture and it fails here. I am new to all this and please explain if I need to install anything or include anything? I have already installed Prime sense drivers. Thanks.
Upvotes: 0
Views: 4583
Reputation: 39796
NO ( if you're trying VideoCapture capture(CV_CAP_OPENNI);
it just depends on that. there's libfreenect or such as well, but that's another story.. )
YES ( that's why it failed, probably ) .
also check: cout << cv::getBuildInformation();
to see, if your opencv libs were build with openni support:
Video I/O:
...
OpenNI: NO
OpenNI PrimeSensor Modules: NO
you'll have to rebuild opencv from src(with openni sdk installed) , if the answer is 'no' there
Upvotes: 0
Reputation: 1198
You can read data from the Kinect sensor using any of these 3 methods,
For further reference, I would like to direct you to this topic: How to take kinect video image and depth image with openCV c++?
HTH
Upvotes: 2