How to read oni file in Processing 2?

流过昼夜 提交于 2019-12-09 13:53:13

问题


I have a Kinect program in Processing 2 that I would like to test or simulate by passing it saved skeletons from an .oni file rather than taking input from the Kinect.

Is it possible to do this, i.e. to get Processing 2 instead of using the Kinect it should read values from the .oni file and produce an output?


回答1:


I recommend using the SimpleOpenNI library:

import SimpleOpenNI.*;

SimpleOpenNI ni;

void setup(){
  size(640,480);
  ni = new SimpleOpenNI(this);
  if(SimpleOpenNI.deviceCount() == 0) ni.openFileRecording("/path/to/yourRecording.oni");
  ni.enableDepth();
}
void draw(){
  ni.update();
  image(ni.depthImage(),0,0);
}

If you're interested in reading every single value in the depth map, check out [this answer](especially the updated code at the end)



来源:https://stackoverflow.com/questions/17044116/how-to-read-oni-file-in-processing-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!