1 | initial version |
OpenCV can use OpenNI for accessing 3D cameras, but KinectV2 doesn't have a good OpenNI integration (however it's possible to do it).
The best solution (this is true for every kind of camera that isn't directly supported by OpenCV) is to use the official API that comes with the camera and convert the buffer to OpenCV Mat (pseudocode):
float *data;
camera.open();
while(1) {
data = camera.captureFrame();
Mat depthframe(512,424,CV_32F,data);
result = process(depthframe);
imshow("Result",result);
}