예제 #1
0
        private void Inicializar()
        {
            #region Rostro
            _deviceManager = _biometricClient.DeviceManager;
            _deviceManager.Initialize();

            UpdateCameraList();
            #endregion

            #region Huella
            //Buscar UrU plugin con error y desactivarlo
            var pgins = Neurotec.Plugins.NPluginManager.GetInstances();

            if (pgins != null && pgins.Length > 0)
            {
                var pginUrU = pgins[0].Plugins["DigitalPersonaUareU"];
                if (pginUrU != null && pginUrU.State == Neurotec.Plugins.NPluginState.PluggingError)
                {
                    pginUrU.Disable();
                    pgins[0].Refresh();
                }
            }
            //

            UpdateScannerList();
            #endregion

            #region Iris
            UpdateIrisScannerList();
            #endregion
        }
예제 #2
0
        private async void MainFormLoadAsync(object sender, EventArgs e)
        {
            _biometricClient = new NBiometricClient
            {
                BiometricTypes           = NBiometricType.Face,
                UseDeviceManager         = true,
                FacesCheckIcaoCompliance = true,
                FacesQualityThreshold    = byte.Parse("0"),
            };

            await _biometricClient.InitializeAsync();

            if (!DesignMode)
            {
                try
                {
                    nViewZoomSlider1.View  = fvPreview;
                    lblStatus.Text         = string.Empty;
                    _deviceManager         = _biometricClient.DeviceManager;
                    saveImageDialog.Filter = NImages.GetSaveFileFilterString();
                    UpdateCameraList();
                }
                catch (Exception ex)
                {
                    Utils.ShowException(ex);
                }
            }
        }
        //Helps to automatically trigger the scanning of next finger if the
        //number of already captured fingers is less than 10
        public void InitNextFingerScan(FingerDescription previousDescription, int previousFingerprintScanPosition)
        {
            _deviceManager = new NDeviceManager();
            if (previousFingerprintScanPosition > 0)
            {
                _fingerprintScanPosition = previousFingerprintScanPosition;
                _FingerDescription       = previousDescription;
            }
            else
            {
                _fingerprintCount = _formMain.GetActiveUserFingerRecordsCount();
                if (_fingerprintCount <= 10)
                {
                    //Get the next finger to be scanned using the previous scanned finger
                    var next = (int)previousDescription;
                    next += 1;
                    _FingerDescription       = (FingerDescription)next;
                    _fingerprintScanPosition = next;
                }
            }

            _biometricClient = new NBiometricClient {
                UseDeviceManager = true, BiometricTypes = NBiometricType.Finger
            };
            _biometricClient.Initialize();

            _EnrollFromSingleFingerScanner = new EnrollFromScanner(this, _CaptureFingerNotifyer, _FingerDescription, _fingerprintScanPosition, _fingerprintCount)
            {
                CaptureFingerNotifyer = _CaptureFingerNotifyer,
                Dock            = DockStyle.Fill,
                BiometricClient = _biometricClient
            };
            Controls.Clear();
            Controls.Add(_EnrollFromSingleFingerScanner);
        }
예제 #4
0
 private void EnrollFromCameraLoad(object sender, EventArgs e)
 {
     try
     {
         if (!DesignMode)
         {
             try
             {
                 lblStatus.Text         = string.Empty;
                 _deviceManager         = _biometricClient.DeviceManager;
                 saveImageDialog.Filter = NImages.GetSaveFileFilterString();
                 UpdateCameraList();
                 StartCapturing();
             }
             catch (Exception ex)
             {
                 AppUtils.ShowException(ex);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
         AppErrorLogger.LogError(ex.StackTrace, ex.Source, ex.Message);
         if (ex.InnerException != null)
         {
             AppErrorLogger.LogError(ex.StackTrace, ex.Source, ex.Message);
         }
     }
 }
예제 #5
0
        public FingerCaptureControl()
        {
            InitializeComponent();
            if (new AppSettings().AppMode.Equals("Verify", StringComparison.InvariantCulture))
            {
                panelId.Visible = true;
            }
            try
            {
                // create a FPScannerMan
                _deviceMan = new NDeviceManager
                {
                    DeviceTypes = NDeviceType.FingerScanner,
                    AutoPlug    = true
                };
                UpdateScannerList();

                _nfView            = new NFingerView();
                _nfView.Dock       = DockStyle.Fill;
                _nfView.BackColor  = panel.BackColor;
                _nfView.AutoScroll = false;
                panel.Controls.Add(_nfView);
            }
            catch (Exception ex)
            {
                Logger.logToFile(ex, AppSettings.ErrorLogPath);
                ShowMessage(ex.Message);
            }
        }
예제 #6
0
        public mainForm()
        {
            InitializeComponent();
            operationsTabControl.SelectedIndexChanged += new EventHandler(operationsTabControl_SelectedIndexChanged);
            videoPlayer.PlayStateChange += new AxWMPLib._WMPOCXEvents_PlayStateChangeEventHandler(videoPlayer_playStateChanged);
            NDeviceManager devMan = new NDeviceManager(NDeviceType.Camera, true, false, System.Threading.SynchronizationContext.Current);

            checkForCamera(devMan);
        }
예제 #7
0
        private void checkForCamera(NDeviceManager _devMan)
        {
            int count = _devMan.Devices.Count();

            if (count > 0)
            {
                camera = (NCamera)_devMan.Devices [0];
            }
            else
            {
                MessageBox.Show("No cameras found");
                Application.Exit();
            }
        }
예제 #8
0
        public FaceForm()
        {
            setCulture();
            InitializeComponent();

            _extractor          = Tools.Extractor;
            _deviceManager      = Devices.Instance.Cameras;
            chbLiveView.Checked = false;

            _deviceManager.DeviceAdded   += new EventHandler <NDeviceManagerDeviceEventArgs>(devMan_DeviceAdded);
            _deviceManager.DeviceRemoved += new EventHandler <NDeviceManagerDeviceEventArgs>(devMan_DeviceRemoved);
            ListAllDevices();

            backgroundWorker = new System.ComponentModel.BackgroundWorker();
            backgroundWorker.WorkerSupportsCancellation = true;
            backgroundWorker.DoWork             += new DoWorkEventHandler(backgroundWorker_DoWork);
            backgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker_RunWorkerCompleted);
        }
예제 #9
0
파일: LockForm.cs 프로젝트: wwj229/NLock
        private void ClientInit()
        {
            _biometricClient = new NBiometricClient {
                BiometricTypes = NBiometricType.Face, UseDeviceManager = true
            };
            _biometricClient.Initialize();
            _biometricClient.FacesTemplateSize = NTemplateSize.Small;

            if (!_isSegmentationActivated.HasValue)
            {
                _isSegmentationActivated = NLicense.IsComponentActivated("Biometrics.FaceSegmentsDetection");
            }

            _biometricClient.FacesDetectAllFeaturePoints = _isSegmentationActivated.Value;
            _biometricClient.FacesQualityThreshold       = 50;

            _deviceManager = _biometricClient.DeviceManager;
        }
예제 #10
0
        public FaceForm()
        {
            setCulture();
            InitializeComponent();

            _extractor = Tools.Extractor;
            _deviceManager = Devices.Instance.Cameras;
            chbLiveView.Checked = false;

            _deviceManager.DeviceAdded += new EventHandler<NDeviceManagerDeviceEventArgs>(devMan_DeviceAdded);
            _deviceManager.DeviceRemoved += new EventHandler<NDeviceManagerDeviceEventArgs>(devMan_DeviceRemoved);
            ListAllDevices();

            backgroundWorker = new System.ComponentModel.BackgroundWorker();
            backgroundWorker.WorkerSupportsCancellation = true;
            backgroundWorker.DoWork += new DoWorkEventHandler(backgroundWorker_DoWork);
            backgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker_RunWorkerCompleted);
        }
예제 #11
0
        private void InitScannerBeginCapture()
        {
            try
            {
                _deviceMan = new NDeviceManager
                {
                    DeviceTypes = NDeviceType.FingerScanner,
                    AutoPlug    = true,
                };
                _nfView              = new NFingerView();
                _nfView.Dock         = DockStyle.Fill;
                _nfView.AutoScroll   = false;
                _nfView.AutoSize     = true;
                _nfView.AutoSizeMode = AutoSizeMode.GrowAndShrink;
                panelFingerPrint.Controls.Add(_nfView);
            }
            catch (Exception ex)
            {
                ShowMessage(ex.Message);
                Logger.logToFile(ex, AppSettings.ErrorLogPath);
            }

            StartCapturing();
        }
예제 #12
0
        private void EnrollFromScannerLoad(object sender, EventArgs e)
        {
            Invoke(new Action(() =>
            {
                try
                {
                    _deviceManager = _biometricClient.DeviceManager;
                    UpdateScannerList();
                    saveFileDialog.Filter = NImages.GetSaveFileFilterString();

                    _nfView = new NFingerView
                    {
                        Dock       = DockStyle.Fill,
                        AutoScroll = true
                    };
                    panel.Controls.Add(_nfView);
                    StartCapturing();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }));
        }
예제 #13
0
        private void bckScanFinger_DoWork(object sender, DoWorkEventArgs e)
        {
            BackgroundWorker bck = (BackgroundWorker)sender;
            try
            {
                int i;
                NDeviceManager devMan = new NDeviceManager(NDeviceType.FingerScanner, true, false);
                int count = devMan.Devices.Count;

                //See if a fingerprint scanner is connected
                if (count > 0)
                {
                    //What if there is more than one scanner
                }
                else
                {
                    GlobalScanStatus = ScanStatus.NoScanner;
                }

                if (count > 1)
                    //What if there is more than one scanner.  We will use the first detected scanner.
                    for (i = 0; i < count; i++)
                    {
                        NDevice device = devMan.Devices[i];
                    }
                i = 0;
                NFScanner fingerScanner = (NFScanner)devMan.Devices[i];
                NFExtractor extractor = new NFExtractor();
                NFRecord record;
                extractor.ReturnedImage = NfeReturnedImage.Binarized;

                NImage image = null;
                while (image == null && !bckScanFinger.CancellationPending)
                {
                    if (bck.CancellationPending)
                    {
                        e.Cancel = true;
                    }
                    else
                    {
                        using ( image = fingerScanner.Capture(5000))
                        {
                            if (image == null)
                            {
                                GlobalScanStatus = ScanStatus.NoTemplateCreated;
                            }
                            else
                            {
                                NfeExtractionStatus extractionStatus;
                                using (NGrayscaleImage grayscaleImage = image.ToGrayscale())
                                {
                                    if (grayscaleImage.ResolutionIsAspectRatio
                                        || grayscaleImage.HorzResolution < 250
                                        || grayscaleImage.VertResolution < 250)
                                    {
                                        grayscaleImage.HorzResolution = 500;
                                        grayscaleImage.VertResolution = 500;
                                        grayscaleImage.ResolutionIsAspectRatio = false;
                                    }

                                    record = extractor.Extract(grayscaleImage, NFPosition.Unknown, NFImpressionType.LiveScanPlain, out extractionStatus);
                                    fingerprintImage = (NImage)image.Clone();
                                    fingerprintImage = NImages.GetGrayscaleColorWrapper(fingerprintImage, resultImageMinColor, resultImageMaxColor);

                                }

                                if (extractionStatus == NfeExtractionStatus.TemplateCreated)
                                {
                                    GlobalScanStatus = ScanStatus.TemplateCreated;
                                    fingerprintTemplate = record;
                                    ScannedTemplated = true;
                                    bck.ReportProgress(1);
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ScanError = ex.Message;
            }

            GlobalScanStatus = ScanStatus.Cancelled;
        }