I don’t know about a “depth file”. But you can get DepthPixel values in Sandbox::frame().
Almost a year ago, as an exploration, I added a rough feature to dump a single frame of depth values to a text file for import into LibreOffice Calc. Using LO’s Color Range conditional cell formatting, I could get a quick,
visual verification that the 300k depth values represented the scene I was capturing with the Kinect.
I hope the following will give you an idea for one way to proceed.
@@ -1143,10 +1150,21 @@ void Sandbox::frame(void)
/* Check if the filtered frame has been updated: */
if(filteredFrames.lockNewValue())
{
/* Update the depth image renderer's depth image: */
depthImageRenderer->setDepthImage(filteredFrames.getLockedValue());
+
+ typedef GLfloat DepthPixel;
+
+ Kinect::FrameBuffer fb = filteredFrames.getLockedValue();
+
+ const DepthPixel *dfPtr = fb.getData<DepthPixel>();
+ const int x = fb.getSize()[0];
+ const int y = fb.getSize()[1];
+ for (unsigned int i = 0; i < x * y; ++i, ++dfPtr) {
+ std::cout << "(" << (i % x) << ", " << floor(i / x) << ") = "<< *dfPtr << std::endl;
+ }
}
if(handExtractor!=0)
{
/* Lock the most recent extracted hand list: */