Android OpenNI - Can't use short array for retrieving Depth Map
I have a problem retrieving the depth map in short[] format, from
PrimeSense camera in Android. This is what I'm using at the moment:
DepthMetaData depthMetaData = depthGenerator.getMetaData();
ShortBuffer depthShortBuffer = depthMetaData.getData().createShortBuffer();
The ShortBuffer class has a method for getting the raw array, but the
object returned by "createShortBuffer()" doesn't seem to be backed up by
an array. So the underlying array is null and I get an
"UnsupportedOperationException" when calling the "array" method:
depthMetaData.getData().createShortBuffer().array();
Using a loop to fill a "short[]" takes too much time and we need to get a
"short[]" data type from the beginning.
Waiting for an advice about how to advance.
Best regards.
No comments:
Post a Comment