最近学习kinect需要在优快云下载一些资源,没有积分无奈只能将自己总结的一些材料发到优快云以赚取积分。。。
- kinect2显示彩色图像
#include
#include <Kinect.h>
#include <opencv2\highgui.hpp>
using namespace std;
using namespace cv;
int main(void)
{
IKinectSensor * mySensor = nullptr; //第1步打开Sensor
GetDefaultKinectSensor(&mySensor);
mySensor->Open();
IColorFrameSource * mySource = nullptr; //第2步获取Source
mySensor->get_ColorFrameSource(&mySource);
int height = 0, width = 0; //取得宽和高等下用
IFrameDescription * myDescription = nullptr;
mySource->get_FrameDescription(&myDescription);
myDescription->get_Height(&height);
myDescription->get_Width(&width);
IColorFrameReader * myReader = nullptr; //第3步打开Reader
mySource->OpenReader(&myReader);
Mat img(height, width, CV_8UC4);
IColorFrame * myFrame = nullptr;
while (1)
{
if (myReader->AcquireLatestFrame(&myF

这篇博客介绍了如何利用kinect2.0与OpenCV库在C++环境中实现彩色图像和红外图像的显示。通过打开默认的KinectSensor并调用相关API,可以成功获取并展示kinect的图像数据。
最低0.47元/天 解锁文章
1万+

被折叠的 条评论
为什么被折叠?



