/// <summary> /// Reset state variables and start capture thread /// </summary> /// <returns>True if Capture successfully started. False otherwise.</returns> public bool StartCapture() { _registrationInProgress = false; _fingerCount = 0; _createRegTemplate.Clear(); try { if (_capturer != null) { _capturer.StartCapture(); return(true); } } catch (DPFP.Error.SDKException) { return(false); } return(false); }
public void OnComplete(object Capture, string ReaderSerialNumber, DPFP.Sample Sample) { FingerPrintScanner.DrawPicture(pic_left, FingerPrintScanner.ConvertSampleToBitmap(Sample)); try { FeatureSet feature = FingerPrintScanner.ExtractFeatures(Sample, DataPurpose.Enrollment); enroller.AddFeatures(feature); FingerPrintScanner.MakeReport(txtStatus, String.Format("Fingerprint samples needed: {0}", enroller.FeaturesNeeded)); switch (enroller.TemplateStatus) { case Enrollment.Status.Failed: FingerPrintScanner.MakeReport(txtStatus, String.Format("Fingerprint samples needed: {0}", enroller.FeaturesNeeded)); break; case Enrollment.Status.Insufficient: break; case Enrollment.Status.Ready: FingerPrintScanner.MakeReport(txtStatus, String.Format("Fingerprint samples needed: {0}", enroller.FeaturesNeeded)); capture.StopCapture(); FingerPrintScanner.MakeTemplate(enroller.Template, this); break; case Enrollment.Status.Unknown: FingerPrintScanner.MakeReport(txtStatus, String.Format("Fingerprint samples needed: {0}", enroller.FeaturesNeeded)); break; default: FingerPrintScanner.MakeReport(txtStatus, String.Format("Fingerprint samples needed: {0}", enroller.FeaturesNeeded)); break; } } catch (Exception) { FingerPrintScanner.MakeReport(txtStatus, String.Format("Fingerprint samples needed: {0}", enroller.FeaturesNeeded)); capture.StopCapture(); enroller.Clear(); capture.StartCapture(); } }
protected override void Process(Sample sample) { base.Process(sample); var features = ExtractFeatures(sample, DPFP.Processing.DataPurpose.Enrollment); // Check quality of the sample and add to enroller if it's good if (features == null) { return; } try { MakeReport("The fingerprint feature set was created."); _enroller.AddFeatures(features); // Add feature set to template. } finally { UpdateStatus(); switch (_enroller.TemplateStatus) { case Enrollment.Status.Ready: // report success and stop capturing SaveTemplate(_enroller.Template); TryClose(); break; case Enrollment.Status.Failed: // report failure and restart capturing _enroller.Clear(); Stop(); UpdateStatus(); //OnTemplate(null); Start(); break; } } }