示例#1
0
        void UpdateSimpleHandTrackerDisplay()
        {
            SimpleSkeletonHandTracker ssht = (SimpleSkeletonHandTracker)handTracker;

            VisualUtil.DrawRectangle(depthCanvas, ssht.InitialHandRect, Brushes.Green,
                                     (float)depthCanvas.ActualWidth / HandInputParams.DepthWidth);
            VisualUtil.DrawRectangle(depthCanvas, ssht.ShiftedRect, Brushes.AliceBlue,
                                     (float)depthCanvas.ActualWidth / HandInputParams.DepthWidth);
        }
示例#2
0
        void UpdateSalienceHandTrackerDisplay()
        {
            SalienceHandTracker sht = (SalienceHandTracker)handTracker;
            var bb = sht.PrevBoundingBoxes;

            if (bb.Count > 0)
            {
                VisualUtil.DrawRectangle(colorCanvas, bb.Last(), Brushes.Red);
            }
            var converted = sht.TemporalSmoothed.ConvertScale <Byte>(255, 0);

            debugColorDisplayManager.UpdateBitmap(converted.Bytes);
            debugColorDisplayManager.UpdateBitmapMask(sht.SaliencyProb.Data);
        }
示例#3
0
        void UpdateDisplay(TrackingResult result)
        {
            colorCanvas.Children.Clear();
            depthCanvas.Children.Clear();
            if (result.DepthBoundingBoxes.Count > 0)
            {
                VisualUtil.DrawRectangle(depthCanvas, result.DepthBoundingBoxes.Last(), Brushes.Red,
                                         (float)depthCanvas.ActualWidth / HandInputParams.DepthWidth);
            }
            if (handTracker != null)
            {
                if (handTracker is SalienceHandTracker)
                {
                    UpdateSalienceHandTrackerDisplay();
                }
                else if (handTracker is StipHandTracker)
                {
                    UpdateStipHandTrackerDisplay();
                }
                else if (handTracker is SimpleSkeletonHandTracker)
                {
                    UpdateSimpleHandTrackerDisplay();
                }
            }
            if (displayDebug)
            {
                if (result.DepthImage != null)
                {
                    debugDepthDisplayManager.UpdateBitmap(result.DepthImage.Bytes);
                }

                if (result.ColorImage != null)
                {
                    debugColorDisplayManager.UpdateBitmap(result.ColorImage.Bytes);
                }
            }
        }