I am able to use SimpleOpenNI to successfully record and replay depth and rgb recordings (.oni files). I would also like to be able to track users from recorded files, in other words be able to easily extract sillhouettes of people from a depth image. This is easy to do with SimpleOpenNI when running connected to a sensor, by calling enableUser()
in the setup()
method, and then obtaining userMap()
or userImage()
during draw calls. The motivation for this is to be able to easily segment out a person's sillouhette from a background. I am using SimpleOpenNI version 1.96.
Here is the code I am using when record data:
SimpleOpenNI context;
public void setup()
{
context = new SimpleOpenNI(this);
// recording
context.enableDepth();
context.enableRGB();
context.enableUser();
context.enableRecorder(recordPath);
// select the recording channels
context.addNodeToRecording(SimpleOpenNI.NODE_DEPTH,true);
context.addNodeToRecording(SimpleOpenNI.NODE_IMAGE,true);
context.addNodeToRecording(SimpleOpenNI.NODE_USER, true);
context.addNodeToRecording(SimpleOpenNI.NODE_PLAYER, true);
context.addNodeToRecording(SimpleOpenNI.NODE_SCENE, true);
context.addNodeToRecording(SimpleOpenNI.NODE_IR, true);
}
Here is the code I am using to replay data:
SimpleOpenNI context;
String recordPath = "/path/to/test.oni";
public void setup()
{
context = new SimpleOpenNI(this,recordPath);
context.enableDepth();
context.enableRGB();
context.enableUser();
}
...
The method call context.enableUser();
when I attempt to replay the data causes the error Couldn't getXN_STREAM_PROPERTY_ZERO_PLANE_DISTANCE Invalid memory access of location 0x4c rip=0x10e2c38e2
. However, I know that in order to obtain information about which users are being tracked, I need to call context.enableUser()
. Removing this line removes the error but does not allow me to access information about which users are being tracked.
Does anybody know if it is possible to track users from pre-recorded .oni
files?