void controller_HeadMove(object sender, HeadEventArgs e)
        {
            if (controller == null || controller.Tracker == null)
            {
                return;
            }

            if (backproj)
            {
                try
                {
                    Camshift camshift = controller.Tracker as Camshift;

                    Bitmap backprojection = camshift.GetBackprojection(
                        PixelFormat.Format24bppRgb, camshift.TrackingObject.Rectangle);

                    if (parent.faceForm != null && !parent.faceForm.IsDisposed)
                    {
                        MatchingTracker matching = parent.faceForm.faceController.Tracker as MatchingTracker;

                        marker.Rectangles = new[] { matching.TrackingObject.Rectangle };
                        marker.ApplyInPlace(backprojection);
                    }


                    pictureBox.Image = backprojection;
                }
                catch
                {
                    pictureBox.Image = null;
                }
            }
        }
Beispiel #2
0
        private void headController1_HeadMove(object sender, HeadEventArgs e)
        {
            int x = (int)(e.X * 20f);
            int y = (int)(e.Y * 20f);
            int s = (int)(e.Scale * 20f);

            tbHorizontal.Value = Math.Min(Math.Max(x, tbHorizontal.Minimum), tbHorizontal.Maximum);
            tbVertical.Value   = Math.Min(Math.Max(y, tbVertical.Minimum), tbVertical.Maximum);
            tbScale.Value      = Math.Min(Math.Max(s, tbScale.Minimum), tbScale.Maximum);
            angleBox1.Angle    = e.Angle;
        }
Beispiel #3
0
 private void controller_HeadEnter(object sender, HeadEventArgs e)
 {
     toolStripStatusLabel1.Text = "Tracking started";
 }