【发布时间】:2013-02-15 21:57:56
【问题描述】:
我正在尝试将 Kinect 传感器的深度数据记录到文件中,然后使用 openNi 播放。 我根据 openNi 的示例编写了一个简单的程序。我正在使用 java 包装器。
问题是,当我尝试读取正在录制的 .oni 文件时,出现以下错误:
org.OpenNI.StatusException: The file is corrupted!
这是我的录音代码:
Context context = new Context();
// add the NITE License
License license = new License("PrimeSense", "0KOIk2JeIBYClPWVnMoRKn5cdY4="); // vendor, key
context.addLicense(license);
DepthGenerator depth = DepthGenerator.create(context);
Recorder recorder = Recorder.create(context, "oni");
context.createProductionTree(recorder.getInfo());
recorder.setDestination(RecordMedium.FILE, "KinectLog.oni");
recorder.addNodeToRecording(depth);
context.startGeneratingAll();
int tmp = 0;
while(tmp < 100){
tmp++;
context.waitAnyUpdateAll();
recorder.Record();
System.out.println("recording");
}
也许我必须在录制后通过调用一些 .release() 方法进行清理? Recorder没有这种方法。
这是我播放 .oni 文件的代码:
Context context = new Context();
// add the NITE License
License license = new License("PrimeSense", "0KOIk2JeIBYClPWVnMoRKn5cdY4="); // vendor, key
context.addLicense(license);
context.openFileRecordingEx("KinectLog.oni");
抛出 StatusException 的是 openFileRecordingEx。
有人知道我做错了什么吗?
【问题讨论】: