Problem in DepthStreamManager

Jun 21, 2014 at 8:38 PM
Edited Jun 21, 2014 at 8:39 PM
Hi,

I am trying to create an application that is able to save all images in a replay file. When I visualize the images in a Image Control they look great, nevertheless when I save it in my HD it looks totaly different.

Image Shown in a Image Control:
http://s103.photobucket.com/user/diasboldrin/media/Good_zps20bb2a52.jpg.html

The same Image but now stored in the HD:
http://s103.photobucket.com/user/diasboldrin/media/Error_zps34c848ca.jpg.html

I want to save the same image shown in the Image Control in my HD.

May someone help me?
Jun 24, 2014 at 12:22 PM
Hi guys,

I found what was wrong. My goal was to create a virtual wall where the users' hand could be cropped easily. In order to do it I define a threshold using the realDepth variable in DepthStreamManager.


if (realDepth < this.GThreshold)
            {
                depthFrame32[i32] = 0;
                depthFrame32[i32 + 1] = 0;
                depthFrame32[i32 + 2] = 0;
                depthFrame32[i32 + 3] = 255;

                switch (user)
                {
                    case 0: // no one
                        depthFrame32[i32] = (byte)(intensity / 32);
                        depthFrame32[i32 + 1] = (byte)(intensity / 32);
                        depthFrame32[i32 + 2] = (byte)(intensity / 32);
                        break;
                    case 1:
                        depthFrame32[i32] = intensity;
                        break;
                    case 2:
                        depthFrame32[i32 + 1] = intensity;
                        break;
                    case 3:
                        depthFrame32[i32 + 2] = intensity;
                        break;
                    case 4:
                        depthFrame32[i32] = intensity;
                        depthFrame32[i32 + 1] = intensity;
                        break;
                    case 5:
                        depthFrame32[i32] = intensity;
                        depthFrame32[i32 + 2] = intensity;
                        break;
                    case 6:
                        depthFrame32[i32 + 1] = intensity;
                        depthFrame32[i32 + 2] = intensity;
                        break;
                    case 7:
                        depthFrame32[i32] = intensity;
                        depthFrame32[i32 + 1] = intensity;
                        depthFrame32[i32 + 2] = intensity;
                        break;
                }
            }
else
            {
                depthFrame32[i32] = 0;
                depthFrame32[i32 + 1] = 0;
                depthFrame32[i32 + 2] = 0;
                depthFrame32[i32 + 3] = 255;                
            }

In order to work correctly we have to know prior the distance between the Kinect sensor and the user. So if the distance is 500mm probably the user's hands will be in a distance between 400mm and 450mm.

I hope it helps someone else.