Getting Depth Value on Kinect SDK 1.6

Posted by AlexanderPD on Stack Overflow See other posts from Stack Overflow or by AlexanderPD
Published on 2012-12-11T16:58:30Z Indexed on 2012/12/11 17:03 UTC
Read the original article Hit count: 287

Filed under:
|
|
|

this is my first try on Kinect and Kinect SDK so I'm having a lot of "newbie issues" :)

my goal is to point my mouse on the Kinect standard video output and get the depth value.

I already have both normal video and depth video outputs by using the 2 "Color Basic-WPF" and "Depth Basic-WPF" samples, and handling mouse events or position is not a problem. In fact i already did all and i already got a depth value, but this value is always HIGHLY imprecise. It jumps from 500 to 4000 by just moving to the next pixel in a plane surface.

So.. I'm pretty sure I'm reading the depth value in the wrong way. This is how i read it:

short debugValue = depthPixels[x*y].Depth;
debug.Text = "X = "+x+", Y = "+y+", value = "+debugValue.ToString();

i know it's pretty out of context, this little piece of code is inside the same SensorDepthFrameReady function in "Depth Basic-WPF"! "x" and "y" are the mouse coordinates and depthPixels is DepthImagePixel[] type, a temporary array filled with the "depthFrame.CopyDepthImagePixelDataTo(this.depthPixels);" instruction.

Depth frame is filled here: DepthImageFrame depthFrame = e.OpenDepthImageFrame()

the "e" comes from here: private void SensorDepthFrameReady(object sender, DepthImageFrameReadyEventArgs e)

and this last one is called here: this.sensor.DepthFrameReady += this.SensorDepthFrameReady;

how i must handle that depth value i get? I know the value must be between 800 and 4000 but i get values between about 500 and about 8000.

i already google a lot (here on SO too) and i still can't understand if the depth value is 11 or 13 bit. The sdk examples uses shrink this value to 8 bit and this is making even more confusion in my head :(

© Stack Overflow or respective owner

Related posts about c#

Related posts about Kinect