【发布时间】:2019-11-25 09:23:25
【问题描述】:
我通过 USB 连接了 Orbbec Astra 深度传感器,设备管理器显示驱动程序已正确安装。
我已经从 orbbec.com 下载了“Astra & OpenNI2”包,但只安装了我从 structure.io 下载的 SensorDriver_V4.3.0.4.exe 和 OpenNI2 包。
我有以下代码,编译得很好。但是在运行时它返回Device open failed: DeviceOpen using default: no devices found。
运行NiViewer.exe 时也会发生同样的情况我在这里做错了什么?是否需要一些额外的驱动程序?
#include "stdafx.h"
#include <OpenNI.h>
int main()
{
openni::Status rc = openni::STATUS_OK;
openni::Device device;
openni::VideoStream depth, color;
const char* deviceURI = openni::ANY_DEVICE;
rc = openni::OpenNI::initialize();
printf("After initialization:\n%s\n", openni::OpenNI::getExtendedError());
rc = device.open(deviceURI);
if (rc != openni::STATUS_OK)
{
printf("Device open failed: %s\n", openni::OpenNI::getExtendedError());
openni::OpenNI::shutdown();
return 1;
}
return 0;
}
【问题讨论】:
标签: visual-c++ visual-studio-2015 openni orbbec