Capture and store depth map images RRS feed

  • Question

  • I need help..

    i want a sample code to capture depth map image every 1 second and save it as JPEG image file..

    then compare it with my data set image and if it match one of those images do *action*

    I need another suggestions too..

    Wednesday, March 7, 2012 8:45 PM

All replies

  • The easiest way to capture a depth frame every second is to hook up to the KinectSensor.OnDepthFrameReady Event and use an integer to count up by one each frame. The framerate may be unstable, so if you need more precision you should use a DispatcherTimer with an interval of 1 second to set a flag that the next frame shall be captured.

    In C# the first solution would look like this:

    int i = 0;
    private void Kinect_DepthFrameReady(object sender, DepthFrameReadyEventArgs e)
                i++;//increase the counter
                if (i<30) return;//only proceed every 30th frame
                i=0;//reset the counter
                //save the depth data...
                //compare with older datasets, maybe in a new thread

    You should not save the depth data to a JPEG file! JPEG is for pictures (depth data is different) and it is compressed, so you would not only need CPU power to save it, but also you loose a significant amout of information! You should save it either (JSON) serialized, or as comma seperated values into a text file.


    Life is unsure - always eat the dessert first!

    Friday, March 9, 2012 8:57 AM
  • Hi all,

    I also need saving depth data information for point a fingertip like in this video:

    Would you like to help me ,how can I get a finger point as a red color in this video?at

    Please tell me which way I should follow?

    Any help will be appreciated.


    • Edited by Gianna6 Wednesday, April 11, 2012 11:10 AM
    Wednesday, April 11, 2012 11:08 AM
  • You coud use scotts depth map filter and modify its source in c++ for taking pictures using kinect instead of using it for video.

    Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering - Yoda. Blog -

    Thursday, April 19, 2012 2:45 PM