none
How to use NUI_IMAGE_STREAM_FLAG_DISTINCT_OVERFLOW_DEPTH_VALUES in C# code? RRS feed

  • Question

  • Hello,

    I am trying to access depth values from the Kinect at greater than 4m distance. My understanding from reading through newsgroups is that this is possible using a flag called NUI_IMAGE_STREAM_FLAG_DISTINCT_OVERFLOW_DEPTH_VALUES . However, I've found no examples of how to use this flag in C#, nor have I found any code examples in C# that demonstrate how to acquire depth values at greater than 4m distance. Searching manually through the Kinect SDK APIs in Visual Studio, I have not been able to find this flag. Could anyone point me to documentation on how to use NUI_IMAGE_STREAM_FLAG_DISTINCT_OVERFLOW_DEPTH_VALUES (or its equivalent) in C# code?

    Thanks very much for any help!

    Monday, February 25, 2013 4:42 AM

Answers

  • The DISTINCT_OVERFLOW_DEPTH_VALUES flag is not what you need. It is specific to the C++ API, and it refers to something unrelated to what you're trying to accomplish.

    The method you seek is DepthImageFrame.CopyDepthImagePixelDataTo (http://msdn.microsoft.com/en-us/library/jj663712.aspx), which was introduced in v1.5 of the Kinect for Windows SDK. This is now the recommended API for retreiving depth data, replacing DepthImageFrame.CopyPixelDataTo).

    The new method copies the depth data into an array of DepthImagePixel structs (unlike CopyPixelDataTo, which copies into an array of short). The DepthImagePixel.Depth property gives you the depth in millimeters (and unlike the data you get from CopyPixelDataTo, no bit-shifting is needed!). The Depth property can return values that exceed DepthImageFrame.MaxDepth.


    John | Kinect for Windows development team

    Thursday, February 28, 2013 1:07 AM

All replies

  • The DISTINCT_OVERFLOW_DEPTH_VALUES flag is not what you need. It is specific to the C++ API, and it refers to something unrelated to what you're trying to accomplish.

    The method you seek is DepthImageFrame.CopyDepthImagePixelDataTo (http://msdn.microsoft.com/en-us/library/jj663712.aspx), which was introduced in v1.5 of the Kinect for Windows SDK. This is now the recommended API for retreiving depth data, replacing DepthImageFrame.CopyPixelDataTo).

    The new method copies the depth data into an array of DepthImagePixel structs (unlike CopyPixelDataTo, which copies into an array of short). The DepthImagePixel.Depth property gives you the depth in millimeters (and unlike the data you get from CopyPixelDataTo, no bit-shifting is needed!). The Depth property can return values that exceed DepthImageFrame.MaxDepth.


    John | Kinect for Windows development team

    Thursday, February 28, 2013 1:07 AM
  • Thank you for the helpful reply! I had been using CopyPixelDataTo, so this is great information.
    Monday, March 18, 2013 10:29 PM