示例#1
0
 internal void Draw(PaintEventArgs e)
 {
     if (_cbxShowScanningWindows.Checked)
     {
         if (_generator.ScanningWindows != null)
         {
             foreach (IBoundingBox bb in _generator.ScanningWindows)
             {
                 DrawingService.DrawBoundingBox(e, bb, DetectorDrawingInfo.ScanningWindowPen);
             }
         }
     }
 }
示例#2
0
 public void Draw(PaintEventArgs e)
 {
     if (_cbxShowAcceptedPatches.Checked)
     {
         if (_classifier.AcceptedPatches != null)
         {
             IBoundingBox[] allWindows = _classifier.ScanningWindowGenerator.ScanningWindows;
             foreach (int windowIndex in _classifier.AcceptedPatches)
             {
                 IBoundingBox window = allWindows[windowIndex];
                 DrawingService.DrawBoundingBox(e, window, DetectorDrawingInfo.VarianceClassifierPen);
             }
         }
     }
 }
示例#3
0
        private void _pnlFrames_Paint(object sender, PaintEventArgs e)
        {
            if (_previousFrame != null && _currentFrame != null)
            {
                e.Graphics.DrawImage(_previousFrame, PreviousFrameLocation);
                e.Graphics.DrawImage(_currentFrame, AdaptPointForCurrentFrame(new Point(0, 0)));

                if (_frmMain.tldRunning)
                {
                    if ((_frmMain.tld as Tld).UseTracker && !Tracker.Failed)
                    {
                        if (_cbxShowPrevOutput.Checked)
                        {
                            DrawingService.DrawBoundingBox(e, Tracker.PrevBoundingBox, TldDrawingInfo.TrackerOutputPen);
                        }
                        if (_cbxShowCurrentOutput.Checked)
                        {
                            DrawingService.DrawBoundingBox(e, CurrentFrameBoundingBox(Tracker.BoundingBox), TldDrawingInfo.TrackerOutputPen);
                        }

                        if (_cbxShowValidShifts.Checked)
                        {
                            foreach (Shift shift in Tracker.ValidShifts)
                            {
                                PointF prev = shift.Previous;
                                PointF forw = AdaptPointForCurrentFrame(shift.Forward);
                                e.Graphics.DrawLine(TldDrawingInfo.TrackerValidShiftPen, prev, forw);
                            }
                        }

                        if (_cbxShowReliableShifts.Checked)
                        {
                            foreach (Shift shift in Tracker.ReliableShifts)
                            {
                                PointF prev = shift.Previous;
                                PointF forw = AdaptPointForCurrentFrame(shift.Forward);
                                e.Graphics.DrawLine(TldDrawingInfo.TrackerReliableShiftPen, prev, forw);
                            }
                        }

                        if (_frmMain._cbxShowGrid.Checked)
                        {
                            DrawingService.DrawPoints(e, Tracker.PrevBoundingBox.GetGridPoints(), TldDrawingInfo.TrackerGridBrush, TldDrawingInfo.TrackerGridPointSize);
                        }

                        if (_frmMain._cbxShowValidTrackingPoints.Checked)
                        {
                            if (Tracker.ValidShifts != null)
                            {
                                PointF[] points = new PointF[Tracker.ValidShifts.Length];
                                for (int i = 0; i < points.Length; i++)
                                {
                                    points[i] = AdaptPointForCurrentFrame(Tracker.ValidShifts[i].Forward);
                                }
                                DrawingService.DrawPoints(e, points, TldDrawingInfo.TrackerValidPointBrush, TldDrawingInfo.TrackerValidPointSize);
                            }
                        }
                        if (_frmMain._cbxShowReliableTrackingPoints.Checked)
                        {
                            if (Tracker.ReliableShifts != null)
                            {
                                PointF[] points = new PointF[Tracker.ReliableShifts.Length];
                                for (int i = 0; i < points.Length; i++)
                                {
                                    points[i] = AdaptPointForCurrentFrame(Tracker.ReliableShifts[i].Forward);
                                }
                                DrawingService.DrawPoints(e, points, TldDrawingInfo.TrackerReliablePointBrush, TldDrawingInfo.TrackerReliablePointSize);
                            }
                        }
                    }
                }
            }
        }