答案 0 :(得分:1)
您必须关闭剪辑,设置#include <Kinect.h>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <Windows.h>
#include <iostream>
using namespace std;
const int width = 512;
const int height = 424;
const int colorwidth = 1920;
const int colorheight = 1080;
IDepthFrameReader* reader; // Kinect depth data source
IKinectSensor* sensor = nullptr;
int main(int argc, char* argv[]) {
if (FAILED(GetDefaultKinectSensor(&sensor))) {
return 19;
}
if (sensor) {
sensor->Open();
IDepthFrameSource* framesource = NULL;
sensor->get_DepthFrameSource(&framesource);
framesource->OpenReader(&reader);
if (framesource) {
framesource->Release();
framesource = NULL;
}
IDepthFrame* frame = NULL;
if (SUCCEEDED(reader->AcquireLatestFrame(&frame))) {
cout << "not bad";
getchar();
return 100;
}
else{
cout << "not found";
getchar();
return 23;
}
}
else {
return -1;
}
}
,参考official doc。