我通过 USB 连接了 Orbbec Astra 深度传感器,设备管理器显示驱动程序已正确安装。
我已经从 orbbec.com 下载了“Astra & OpenNI2”包,但只安装了SensorDriver_V4.3.0.4.exe
我从 structure.io 下载的 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;
}