本文主要是介绍使用Kinect SDK获取深度图与彩色图并保存,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
感谢http://blog.csdn.net/zouxy09
#include <stdlib.h>
#include <iostream>
#include <string>
#include "OpenNI.h"
#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "Windows.h"
#include <Shlobj.h>
#include "NuiApi.h"
#include <sstream>#include <opencv2/opencv.hpp> using namespace std;
using namespace cv;
using namespace openni;int frameNo = 1;int main(int argc, char *argv[])
{Mat colorImage;Mat depthImage;colorImage.create(480, 640, CV_8UC3);depthImage.create(480,640,CV_8UC1);//1、初始化NUI HRESULT hr = NuiInitialize(NUI_INITIALIZE_FLAG_USES_COLOR | NUI_INITIALIZE_FLAG_USES_DEPTH); if (FAILED(hr)) { cout<<"NuiInitialize failed"<<endl;
这篇关于使用Kinect SDK获取深度图与彩色图并保存的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!