Пример #1
0
        public TrainingForm(String _name)
        {
            InitializeComponent();

            name = _name;

            photoCounter = 3;

            capture = new Capture();
            CameraCapture.Init(capture);
            BlinkDetector.Init(new CascadeClassifier(eyePairClassifier), new CascadeClassifier(eyeClassifier));
            FaceDetection.Init(new CascadeClassifier(faceClassifier));
            TrainingStateManager.Clear();
            BlinkStateManager.Clear();

            labelInstruction.Text = "We will now capture a few images \nof your face";
            labelRemaining.Text   = photoCounter + " more capture to finish";
            buttonFinish.Enabled  = false;
            CameraCapture.Start();

            timer          = new DispatcherTimer();
            timer.Tick    += ProcessTrainFrame;
            timer.Interval = new TimeSpan(0, 0, 0, 0, 1);
            timer.Start();
        }
Пример #2
0
 private void checkBlink(Image <Gray, byte> faceImage)
 {
     printInformation();
     BlinkDetector.Detect(faceImage);
     if (BlinkStateManager.LastAction.Equals(BlinkStateManager.LAST_ACTION.BLINK))
     {
         if (username.Equals(detected))
         {
             Thread thread = new Thread(new ThreadStart(RunMainForm));
             thread.Start();
             this.Close();
         }
     }
     return;
 }
Пример #3
0
        private void CheckBlink(Image <Gray, byte> faceImage)
        {
            //print method for debugging purpose
            PrintBlinkInformations();
            BlinkDetector.Detect(faceImage);
            if (BlinkStateManager.LastAction.Equals(BlinkStateManager.LAST_ACTION.BLINK))
            {
                if (FaceRecognition.SaveTrainingData(faceImage, name))
                {
                    BlinkStateManager.Clear();
                    photoCounter--;

                    if (photoCounter <= 0)
                    {
                        buttonFinish.Enabled = true;
                        photoCounter         = 0;
                    }
                }
            }
            return;
        }
Пример #4
0
        public SecurityForm()
        {
            InitializeComponent();

            username = Authorization.username;

            capture = new Capture();
            CameraCapture.Init(capture);
            BlinkDetector.Init(new CascadeClassifier(eyePairClassifier), new CascadeClassifier(eyeClassifier));
            FaceDetection.Init(new CascadeClassifier(faceClassifier));
            SecurityStateManager.Clear();
            BlinkStateManager.Clear();

            labelInstruction.Text = "We will now capture a few images \nof your face";

            CameraCapture.Start();

            timer          = new DispatcherTimer();
            timer.Tick    += ProcessSecurityFrame;
            timer.Interval = new TimeSpan(0, 0, 0, 0, 1);
            timer.Start();
        }