How to use Kinect with OpenCV?
I want to get depth and color images from Kinect, how can I do this? Is there any tutorial or code sample?
I want to get depth and color images from Kinect, how can I do this? Is there any tutorial or code sample?
You can enable OpenNI when building OpenCV from sources, by checking the WITH_OPENNI CMake option. Then, in your code :
cv::VideoCapture capture(CV_CAP_OPENNI);
for(;;)
{
cv::Mat depthMap;
cv::Mat rgbImage
capture.grab();
capture.retrieve( depthMap, OPENNI_DEPTH_MAP );
capture.retrieve( bgrImage, OPENNI_BGR_IMAGE );
if( cv::waitKey( 30 ) >= 0 )
break;
}
You can find more information here.
There is also a sample 'samples/cpp/openni_capture.cpp'
Asked: 2012-07-29 00:44:34 -0600
Seen: 2,632 times
Last updated: Jul 30 '12
error LNK2019: unresolved external symbol "void __cdecl cv::inpaint
Head (not face) detection and tracking in depth maps
How to get distance from depth-map in Kinect?
Depth from Intensity and Photometric Stereo
Raw disparity aquisition for Kinect camera
How can I measure distances with OpenNI ?
There is the Kinect SDK versions 1.x and 2.x. It comes with C# and C++ code, I believe. This way you control the Kinect yourself, and don't have to build OpenCV with OpenNI support.