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?
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