Kinect Depth FPS slows Significantly when Human Detected
===

I have a application where I create my own Depth Frame. The problem is when a human is detected the FPS of the depth (and then the color too) slows down significantly. [Here](http://youtu.be/m09Pxz0yNpc) is a movie of when the frame slows down. The code I am using:

            using (DepthImageFrame DepthFrame = e.OpenDepthImageFrame())
            {
                depthFrame = DepthFrame;
                pixels1 = GenerateColoredBytes(DepthFrame);

                depthImage = BitmapSource.Create(
                    depthFrame.Width, depthFrame.Height, 96, 96, PixelFormats.Bgr32, null, pixels1,
                    depthFrame.Width * 4);

                depth.Source = depthImage;
            }

    ...

        private byte[] GenerateColoredBytes(DepthImageFrame depthFrame2)
        {
            short[] rawDepthData = new short[depthFrame2.PixelDataLength];
            depthFrame.CopyPixelDataTo(rawDepthData);

            byte[] pixels = new byte[depthFrame2.Height * depthFrame2.Width * 4];

            const int BlueIndex = 0;
            const int GreenIndex = 1;
            const int RedIndex = 2;


            for (int depthIndex = 0, colorIndex = 0;
                depthIndex < rawDepthData.Length && colorIndex < pixels.Length;
                depthIndex++, colorIndex += 4)
            {
                int player = rawDepthData[depthIndex] & DepthImageFrame.PlayerIndexBitmask;

                int depth = rawDepthData[depthIndex] >> DepthImageFrame.PlayerIndexBitmaskWidth;

                byte intensity = CalculateIntensityFromDepth(depth);
                pixels[colorIndex + BlueIndex] = intensity;
                pixels[colorIndex + GreenIndex] = intensity;
                pixels[colorIndex + RedIndex] = intensity;

                if (player > 0)
                {
                    pixels[colorIndex + BlueIndex] = Colors.Gold.B;
                    pixels[colorIndex + GreenIndex] = Colors.Gold.G;
                    pixels[colorIndex + RedIndex] = Colors.Gold.R;
                }
            }

            return pixels;
        }

FPS is quite crucial to me since I am making an app that saves pictures of people when they are detected. How can I maintain a faster FPS? Why is my application doing this? 