UnresolvedSymbols
UnresolvedSymbols

Reputation: 11

To Display RGB video frame using opencv and kinect primesense camera?

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.

  1. Is it possible to use Kinect prime sense camera without using OpenNI installed?
  2. Do I need to install OpenNI and link it to OpenCV and all stuff just to use RGB camera from Prime sense device?

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

Answers (2)

berak
berak

Reputation: 39796

  1. 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.. )

  2. 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

scap3y
scap3y

Reputation: 1198

You can read data from the Kinect sensor using any of these 3 methods,

  1. Microsoft Kinect for Windows SDK
  2. OpenKinect's libfreenect API
  3. OpenNI + OpenKinect

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

Related Questions