Provides data to head movement events.
Inheritance: System.EventArgs
示例#1
0
        void controller_HeadMove(object sender, HeadEventArgs e)
        {
            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;
            }
        }
示例#2
0
 private void controller_HeadMove(object sender, Accord.Controls.Vision.HeadEventArgs e)
 {
     x = (int)(e.X * 20f);
     //toolStripStatusLabel1.Text = x.ToString();
     //label1.Text = e.X.ToString();
     //label2.Text = e.Y.ToString();
     //label3.Text = x.ToString();
 }
示例#3
0
        private void controller_HeadMove(object sender, Accord.Controls.Vision.HeadEventArgs e)
        {
            //x = -30;
            x = (int)(e.X * 20f);

            switch (x)
            {
            case -30:
                yesProgressBar.Value = 0;
                noProgressBar.Value  = 0;
                break;

            case -32:
                yesProgressBar.Value = 30;
                break;

            case -34:
                yesProgressBar.Value = 60;
                break;

            case -35:
                yesProgressBar.Value = 90;
                break;

            case -36:
                yesProgressBar.Value = 100;
                break;

            case -28:
                noProgressBar.Value = 30;
                break;

            case -25:
                noProgressBar.Value = 60;
                break;

            case -22:
                noProgressBar.Value = 90;
                break;

            case -24:
                noProgressBar.Value = 100;
                break;
            }
            if (x == -36)
            {
                parent.yesNo = 1;

                this.Close();
            }
            else if (x == -22)
            {
                parent.yesNo = 2;
                //MessageBox.Show("No Selected");
                this.Close();
            }
        }
示例#4
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;
        }
示例#5
0
 /// <summary>
 ///   Called when a head movement is detected.
 /// </summary>
 ///
 protected virtual void OnHeadMove(HeadEventArgs args)
 {
     if (HeadMove != null)
     {
         if (SynchronizingObject != null &&
             SynchronizingObject.InvokeRequired)
         {
             SynchronizingObject.BeginInvoke(
                 HeadMove, new object[] { this, args });
         }
         else
         {
             HeadMove(this, args);
         }
     }
 }
示例#6
0
        /// <summary>
        ///   Called when a face enters the scene.
        /// </summary>
        ///
        protected virtual void OnHeadEnter(HeadEventArgs args)
        {
            IsTracking  = true;
            IsDetecting = false;

            if (HeadEnter != null)
            {
                if (SynchronizingObject != null &&
                    SynchronizingObject.InvokeRequired)
                {
                    SynchronizingObject.BeginInvoke(
                        HeadEnter, new object[] { this, args });
                }
                else
                {
                    HeadEnter(this, args);
                }
            }
        }
示例#7
0
        /// <summary>
        ///   Called when a face enters the scene.
        /// </summary>
        /// 
        protected virtual void OnHeadEnter(HeadEventArgs args)
        {
            IsTracking = true;
            IsDetecting = false;

            if (HeadEnter != null)
            {
                if (SynchronizingObject != null &&
                    SynchronizingObject.InvokeRequired)
                {
                    SynchronizingObject.BeginInvoke(
                        HeadEnter, new object[] { this, args });
                }
                else
                {
                    HeadEnter(this, args);
                }
            }
        }
示例#8
0
 /// <summary>
 ///   Called when a head movement is detected.
 /// </summary>
 /// 
 protected virtual void OnHeadMove(HeadEventArgs args)
 {
     if (HeadMove != null)
     {
         if (SynchronizingObject != null &&
             SynchronizingObject.InvokeRequired)
         {
             SynchronizingObject.BeginInvoke(
                 HeadMove, new object[] { this, args });
         }
         else
         {
             HeadMove(this, args);
         }
     }
 }
示例#9
0
 private void controller_HeadEnter(object sender, HeadEventArgs e)
 {
     toolStripStatusLabel1.Text = "Tracking started";
 }
示例#10
0
 private void controller_HeadEnter(object sender, Accord.Controls.Vision.HeadEventArgs e)
 {
 }