接OpenCV中Kinect的使用(1),主要讲述OpenCV中关于Kinect接口(类 VideoCapture )的一些使用介绍。html
类 VideoCapture 支持Kinect传感器。使用 VideoCapture 里的接口,能够从Kinect获取深度图,RGB图像和其余格式的输出,主要包括: ide
1)来自深度传感器的数据:post
2)来自RGB图像传感器的数据:ui
获取多个Kinect数据,可以使用 VideoCapture::grab 和 VideoCapture::retrieve,例如:url
1 cv::VideoCapture capture = VideoCapture( CV_CAP_OPENNI ); 2 capture.set( CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION_ON, 1.0 ); 3 capture.grab(); 4 capture.retrieve( scene_img, CV_CAP_OPENNI_BGR_IMAGE ); 5 capture.retrieve( depthImg, CV_CAP_OPENNI_DEPTH_MAP ); 6 capture.retrieve( cloudImg, CV_CAP_OPENNI_POINT_CLOUD_MAP );
其中,set用来设置Kinect数据属性,包括:spa
当读写特定传感器属性时,必须用此标志指定传感器。以下属性可透过OpenNI接口支持:code
1)图像传感器: htm
2)深度传感器:blog
3)一些”generator type + property”被定觉得一个标志:接口
参考资料:
2013-10-28