Example #1
0
        private async void scanButton_Click(object sender, EventArgs e)
        {
            #region scan
            if (_biometricClient.FingerScanner == null)
            {
                MessageBox.Show(@"Seleccione un scanner de la lista por favor !");
            }
            else
            {
                EnableHuellaControls(true);
                lblQuality.Text = String.Empty;

                // Create a finger
                _subjectFinger = new NFinger();

                // Set Manual capturing mode if not automatic selected
                if (!chbScanAutomatically.Checked)
                {
                    _subjectFinger.CaptureOptions = NBiometricCaptureOptions.Manual;
                }

                // Add finger to the subject and fingerView
                _subject = new NSubject();
                _subject.Fingers.Add(_subjectFinger);
                _subjectFinger.PropertyChanged += OnAttributesPropertyChanged;
                fingerView.Finger     = _subjectFinger;
                fingerView.ShownImage = ShownImage.Original;

                // Begin capturing
                _biometricClient.FingersReturnBinarizedImage = true;
                NBiometricTask task          = _biometricClient.CreateTask(NBiometricOperations.Capture | NBiometricOperations.CreateTemplate, _subject);
                var            performedTask = await _biometricClient.PerformTaskAsync(task);

                OnEnrollCompleted(performedTask);
            }
            #endregion
        }
Example #2
0
        private async void BtnStartClickAsync(object sender, EventArgs e)
        {
            if (capturedFaces.Count == 7)
            {
                MessageBox.Show("All Faces captured.");
                return;
            }

            if (_biometricClient.FaceCaptureDevice == null)
            {
                MessageBox.Show(@"Please select camera from the list");
                return;
            }

            // Set face capture from stream
            _face = new NFace {
                CaptureOptions = NBiometricCaptureOptions.Stream
            };
            _subject = new NSubject();
            _subject.Faces.Add(_face);
            fvPreview.Face       = _face;
            icaoWarningView.Face = _face;

            _biometricClient.FacesCheckIcaoCompliance = true;

            var task = _biometricClient.CreateTask(NBiometricOperations.Capture | NBiometricOperations.Segment | NBiometricOperations.CreateTemplate, _subject);

            /*var task = _biometricClient.CreateTask(NBiometricOperations.Capture | NBiometricOperations.Segment, _subject);*/
            lblStatus.Text = string.Empty;
            EnableControls(true);
            try
            {
                var performedTask = await _biometricClient.PerformTaskAsync(task);

                OnCapturingCompleted(performedTask);
            }
            catch (Exception ex)
            {
                Utils.ShowException(ex);
                lblStatus.Text = string.Empty;
                EnableControls(false);
                var a = 8;
            }
        }
        private async void btnIdentifyFromScanner_Click(object sender, EventArgs e)
        {
            using (var biometricClient = new NBiometricClient {
                UseDeviceManager = true
            })
                using (var deviceManager = biometricClient.DeviceManager)
                {
                    deviceManager.DeviceTypes = NDeviceType.FingerScanner;
                    deviceManager.Initialize();
                    biometricClient.FingerScanner = (NFScanner)deviceManager.Devices[0];
                    if (biometricClient.FingerScanner == null)
                    {
                        MessageBox.Show(@"Please connect a fingerprint scanner");
                    }
                    else
                    {
                        subjectFinger = new NFinger();
                        MessageBox.Show("Place your finger on the scanner");

                        subjectFinger.CaptureOptions = NBiometricCaptureOptions.Stream;

                        subject = new NSubject();
                        subject.Fingers.Add(subjectFinger);

                        subjectFinger.PropertyChanged  += OnAttributesPropertyChanged;
                        FingerViewIdentification.Finger = subjectFinger;

                        FingerViewIdentification.ShownImage = ShownImage.Original;
                        FingerViewIdentification.Show();
                        biometricClient.FingersReturnBinarizedImage = true;

                        NBiometricTask task = biometricClient.CreateTask(NBiometricOperations.Capture /* | NBiometricOperations.CreateTemplate*/, subject);
                        //NBiometricStatus status = biometricClient.Capture(subject);
                        //status = biometricClient.CreateTemplate(subject);
                        var performTask = await biometricClient.PerformTaskAsync(task);

                        // EnrollmentFromScanner enrollmentFromScanner = new EnrollmentFromScanner(subjectID, subject);
                        IdentificationFromScanner identificationByScanner = new IdentificationFromScanner(subjectID, subject);
                    }
                }
        }