/// <summary>
        /// Helper function to draw constructed background frame.
        /// </summary>
        public void Draw(MainWindow mainWindow)
        {
            if (_frameCounter != _maxTemporalFrames)
            {
                return;
            }

            GraphicsUtils.RenderDepthPixels(mainWindow, TemporalImage);
        }
        public static void RenderDepthPixels(MainWindow mainWindow,CameraSpacePoint[] pointCloud)
        {
            byte[] intensityMap = ImageUtils.CalculateIntensityFromCameraSpacePoints(pointCloud);

            DrawCanvasOnMap(intensityMap);
            ClearCanvas();

            GlobVar.IntensityBitmap.WritePixels(
                new Int32Rect(0, 0, GlobVar.IntensityBitmap.PixelWidth, GlobVar.IntensityBitmap.PixelHeight),
                intensityMap,
                GlobVar.IntensityBitmap.PixelWidth * GlobVar.IntensityBitmap.Format.BitsPerPixel / 8,
                0);

            var canvas = new Canvas
            {
                Width = 700,
                Height = 580
            };

            if (BodyUtils.HasBodyTracking() & Logger.DrawEnergyValue)
            {
                DrawEnergyValue(canvas);
            }

            canvas.Background = new ImageBrush(GlobVar.IntensityBitmap);
            mainWindow.Content = canvas;
            mainWindow.Show();
        }