public static FingerPrint ToFingerPrint(this Sample sample) { var features = sample.ExtractFeatures(DataPurpose.Verification); try { var list = Models.FingerPrint.Cache.ToList(); foreach (var finger in list) { using (var ms = new MemoryStream(finger.Template)) { var template = new Template(ms); var result = new Verification.Result(); Verifier.Verify(features, template, ref result); if (result.Verified) { return(finger); } } } } catch (Exception) { //throw; } return(null); }
private void verifyControl_OnComplete(object Control, DPFP.FeatureSet featureSet, ref DPFP.Gui.EventHandlerStatus EventHandlerStatus) { if (!chkTimeInAM.Checked && !chkTimeOutAM.Checked && !chkTimeInPM.Checked && !chkTimeOutPM.Checked && !chkTimeOutEvening.Checked && !chkTimeInEvening.Checked) { lblTimeLog.Text = "Toggle event first."; return; } var ver = new Verification(); var res = new Verification.Result(); //ClearProfile(); var stat = 0; // Compare feature set with all stored templates. foreach (var ft in fingerTemplateList.Where(ft => ft.FPTemplateFile != null)) { // Compare feature set with particular template. ver.Verify(featureSet, ft.FPTemplateFile, ref res); if (!res.Verified) { continue; } GetProfile(ft.EmpID); stat = 1; break; // success } ShowNotFound(stat); }
/// <summary> /// Used to authenticate a user's fingerprint (by testing his finger' template). /// </summary> /// <param name="templateToCheck">A DigitalPersona SDK Template instance, corresponding to a user's finger.</param> /// <returns>True if template match with last sample. False otherwise.</returns> public bool DoesTemplateMatch(Template templateToCheck) { var rslt = new Verification.Result(); _verFeatures = ExtractFeatures(_lastSample, DataPurpose.Verification); _verify.Verify(_verFeatures, templateToCheck, ref rslt); return(rslt.Verified); }
public static Verification.Result VerificationResult(Sample sample, Verification verificator, byte[] fingerprint) { Verification.Result res = new Verification.Result(); try { Template template = new Template(new MemoryStream(fingerprint)); FeatureSet features = ExtractFeatures(sample, DataPurpose.Verification); verificator.Verify(features, template, ref res); } catch (Exception) { } return(res); }
private bool VerifyFingerprints(DPFP.Template TemplateLeftIndex, DPFP.FeatureSet FeatureSet) { Verification.Result Result = new Verification.Result(); Verification Verification = new Verification(); // Verify the left index finger. Verification.Verify(FeatureSet, TemplateLeftIndex, ref Result); if (Result.Verified) { return(true); } // No match occurred. return(false); }
/// <summary> /// Used to authenticate a user's fingerprint (by testing his finger' template). /// </summary> /// <param name="templateToCheck">A base64-encoded DigitalPersona SDK Template, corresponding to a user's finger.</param> /// <returns>True if template match with last sample. False otherwise.</returns> public bool DoesTemplateMatch(string templateToCheck) { var template = DecodeBase64Template(templateToCheck); if (template == null) { return(false); } var rslt = new Verification.Result(); _verFeatures = ExtractFeatures(_lastSample, DataPurpose.Verification); _verify.Verify(_verFeatures, template, ref rslt); return(rslt.Verified); }
public bool NonUnique(ref Bitmap LeftFinger, ref Bitmap RightFinger) { try { // convert the leftfinger to sample Sample LeftSample = ConvertRawBmpAsSample(LeftFinger); // convert the right finger as template Template RightTemplate = ConvertRawBmpAsTemplate(RightFinger, DataPurpose.Verification); // Process the sample and create a feature set for the enrollment purpose. FeatureSet features = ExtractFeatures(LeftSample, DataPurpose.Verification); Stopwatch sw = new Stopwatch(); // Check quality of the sample and start verification if it's good if (features != null & RightTemplate != null) { // loads the collection Verification.Result result = new Verification.Result(); // timer for current comparison sw.Start(); result = Verification.Verify(features, RightTemplate, 0x7FFFFFFF / 100000); if (result.Verified) { return(true); } else { return(false); } sw.Stop(); } else { throw new Exception("Fingerprint is of low quality"); } } catch (Exception ex) { throw ex; } return(false); }
protected virtual void Process(Sample Sample) { Application.Current.Dispatcher.Invoke(delegate { lblNotValidUser.Visibility = Visibility.Hidden; }); // Process the sample and create a feature set for the enrollment purpose. FeatureSet features = ExtractFeatures(Sample, DataPurpose.Verification); // Check quality of the sample and start verification if it's good if (features != null) { foreach (Usuario usuario in _usuarios ?? new List <Usuario>()) { if (usuario.HuellaDigital != null && usuario.HuellaDigital.Length > 0) { Template = new Template(); Template.DeSerialize(usuario.HuellaDigital); // Compare the feature set with our template Verification.Result result = new Verification.Result(); Verificator.Verify(features, Template, ref result); //UpdateStatus(result.FARAchieved); if (result.Verified) { Application.Current.Dispatcher.Invoke(delegate { App.usuario = usuario; MainWindow main = new MainWindow(); Application.Current.MainWindow = main; Stop(); Close(); main.Show(); }); return; } } } Application.Current.Dispatcher.Invoke(delegate { lblNotValidUser.Visibility = Visibility.Visible; }); } }
private void VerifyOnDoWork(object sender, DoWorkEventArgs doWorkEventArgs) { if (!_beneficiaryObjs.Any() || _beneficiaryObjs == null) { _verifiedBeneficiaryObjs = new List <BeneficiaryObj>(); return; } _verifiedBeneficiaryObjs = new List <BeneficiaryObj>(); var ver = new Verification(); var res = new Verification.Result(); foreach (var thisBeneficiary in _beneficiaryObjs) { if (thisBeneficiary == null || thisBeneficiary.BeneficiaryId < 1) { continue; } var fingerTemplates = thisBeneficiary.FingerTemplates; if (Array.TrueForAll(fingerTemplates, x => x.Equals(null))) { continue; } foreach (var fingerTemplate in fingerTemplates) { if (fingerTemplate != null) { ver.Verify(_featureSet, fingerTemplate, ref res); if (res.Verified) { _verifiedBeneficiaryObjs.Add(thisBeneficiary); break; } } } if (_verifiedBeneficiaryObjs.Any() && _verifiedBeneficiaryObjs.Count == 1) { break; } } }