Get a specific kinect depth value

I'm currently trying to do hand / finger tracking using kinect in XNA. To do this, I need to specify the depth range that is required to render my program. I looked, and I do not understand how this is done. As far as I can tell, kinect depth values ​​only work with the predefined range found in Stream depth.

What I would like to do is make it modular so that I can change the range of depth that my kinect does. I know that this was before, but I cannot find anything on the Internet that can show me how to do this.

Can someone please help me?

I made it possible to display the standard depth view using kinect, and the method I made to convert the depth frame is as follows (I feel this is something here, I need to install)

private byte[] ConvertDepthFrame(short[] depthFrame, DepthImageStream depthStream, int depthFrame32Length) { int tooNearDepth = depthStream.TooNearDepth; int tooFarDepth = depthStream.TooFarDepth; int unknownDepth = depthStream.UnknownDepth; byte[] depthFrame32 = new byte[depthFrame32Length]; for (int i16 = 0, i32 = 0; i16 < depthFrame.Length && i32 < depthFrame32.Length; i16++, i32 += 4) { int player = depthFrame[i16] & DepthImageFrame.PlayerIndexBitmask; int realDepth = depthFrame[i16] >> DepthImageFrame.PlayerIndexBitmaskWidth; // transform 13-bit depth information into an 8-bit intensity appropriate // for display (we disregard information in most significant bit) byte intensity = (byte)(~(realDepth >> 8)); if (player == 0 && realDepth == 00) { // white depthFrame32[i32 + RedIndex] = 255; depthFrame32[i32 + GreenIndex] = 255; depthFrame32[i32 + BlueIndex] = 255; } // omitted other if statements. Simple changed the color of the pixels if they went out of the pre=set depth values else { // tint the intensity by dividing by per-player values depthFrame32[i32 + RedIndex] = (byte)(intensity >> IntensityShiftByPlayerR[player]); depthFrame32[i32 + GreenIndex] = (byte)(intensity >> IntensityShiftByPlayerG[player]); depthFrame32[i32 + BlueIndex] = (byte)(intensity >> IntensityShiftByPlayerB[player]); } } return depthFrame32; } 

I have a strong hunch that I need to change the values ​​of int player and int realDepth, but I cannot be sure.

+4
source share
1 answer

Kinect for Windows Toolkit 1.8.0 has a new example called Adaptive UI-WPF . This applies directly to the viewing section of the interaction zone. Take a look at the code for setting Near and Far Boundary. This should be useful for your situation. ,

0
source

Source: https://habr.com/ru/post/1436106/


All Articles