Ejemplo n.º 1
0
        private void ProcessSingle(Object sender,FingerImage image)
        {
            try
            {
                if (isBusy && !isVerifyingPalm)
                {
                    return;
                }
                if (sender == currentDevice)
                {
                    FingerPicture pic = image.MakePicture();
                    showImage(pic);
                    if (isVerifyingPalm)
                    {
                        var verifyList = new List <FingerTemplate>();
                        verifyList.Add(currentDevice.Extract(image));
                        BiometricsEnrolled(this,verifyList);
                        return;
                    }

                    var candidates = new ComparsionCandidates(currentCredential.fingers);

                    /////////////
                    IDeviceControl        currDeviceControl;
                    List <FingerTemplate> matchedTemplates;
                    foreach (var devCtrl in Owner.PluginManager.DeviceControls)
                    {
                        if (devCtrl.ActiveDevices.Contains(currentDevice))
                        {
                            currDeviceControl = devCtrl;
                            int fingerIndex = currDeviceControl.Match(currentDevice.Extract(image),candidates.Candidates.ToArray(),out matchedTemplates);

                            if (fingerIndex == 0)
                            {
                                if (_controlType == ControlTypeEnum.FINGERPRINT_CONTROL_TYPE)
                                {
                                    fingerDisplay.ShowPopUp("Finger is not registered");
                                }
                                else if (_controlType == ControlTypeEnum.PALM_CONTROL_TYPE)
                                {
                                    fingerDisplay.ShowPopUp("Palm is not registered");
                                }
                                UpdateFingers();
                            }
                            else
                            {
                                if (_controlType == ControlTypeEnum.FINGERPRINT_CONTROL_TYPE)
                                {
                                    fingerDisplay.ShowPopUp("Finger is registered as " + FingerCredential.GetFingerName(candidates.PositionOf(matchedTemplates[0])));
                                    fingerChooser.ShowFinger(candidates.PositionOf(matchedTemplates[0]));
                                }
                                else if (_controlType == ControlTypeEnum.PALM_CONTROL_TYPE)
                                {
                                    fingerDisplay.ShowPopUp("Palm is registered as " + FingerCredential.GetFingerName(candidates.PositionOf(matchedTemplates[0])));
                                    if (candidates.PositionOf(matchedTemplates[0]) == 10)
                                    {
                                        if (highlightedPalm == 11)
                                        {
                                            palmEnrollControl.RightStatePalmP = StatePalm.WhiteBlack;
                                        }
                                        if (palmEnrollControl.LeftStatePalmP != StatePalm.Green)
                                        {
                                            palmEnrollControl.LeftStatePalmP = StatePalm.GreenBlack;
                                            highlightedPalm = 10;
                                        }
                                    }
                                    else if (candidates.PositionOf(matchedTemplates[0]) == 11)
                                    {
                                        if (highlightedPalm == 10)
                                        {
                                            palmEnrollControl.LeftStatePalmP = StatePalm.WhiteBlack;
                                        }
                                        if (palmEnrollControl.RightStatePalmP != StatePalm.Green)
                                        {
                                            palmEnrollControl.RightStatePalmP = StatePalm.GreenBlack;
                                            highlightedPalm = 11;
                                        }
                                    }
                                }
                                // Reset fingers after all
                                textReset = RESETER_TEXT_LIFETIME_MS;
                            }
                        }
                    }
                    /////////////
                    currentDevice.Dispatch(COMMAND.SINGLECAPTURE_START);
                }
            }
            catch (Exception ex)
            {
                //Log.Info(ex);
            }
        }
Ejemplo n.º 2
0
 private void OnSingleCaptured(FingerImage image)
 {
     Ambassador.AddMessage(new MBiometricsSingleCaptured(this, image));
 }
Ejemplo n.º 3
0
 public FingerTemplate Extract(FingerImage image)
 {
     return(_devControl.Extract(image));
 }