Beispiel #1
0
 public void OnReaderConnect(object Capture, string ReaderSerialNumber)
 {
     Dejitaru.SetControlProperty(this, lstatus, "Text", "Connected");
     Dejitaru.SetControlProperty(this, lstatus, "ForeColor", Color.LightGreen);
     Dejitaru.SetControlProperty(this, btnverify, "Visible", true);
     Dejitaru.SetControlProperty(this, btnenroll, "Visible", true);
     SetControl();
 }
Beispiel #2
0
 public void OnReaderDisconnect(object Capture, string ReaderSerialNumber)
 {
     Dejitaru.SetControlProperty(this, lstatus, "Text", "Disconnected");
     Dejitaru.SetControlProperty(this, lstatus, "ForeColor", Color.Red);
     Dejitaru.SetControlProperty(this, btnverify, "Visible", false);
     Dejitaru.SetControlProperty(this, btnenroll, "Visible", false);
     Dejitaru.SetControlProperty(this, prbenroll, "Visible", false);
     Dejitaru.SetControlProperty(this, lblnote, "Visible", false);
     Dejitaru.SetControlProperty(this, lblnote, "Text", "");
 }
Beispiel #3
0
 private void Stop()
 {
     if (Capturer != null)
     {
         try
         {
             Capturer.StopCapture();
         }
         catch
         {
             Dejitaru.SetControlProperty(this, lstatus, "Text", "Can't stop capture.");
         }
     }
 }
Beispiel #4
0
 private void Start()
 {
     if (Capturer != null)
     {
         try
         {
             Capturer.StartCapture();
             Dejitaru.SetControlProperty(this, lstatus, "Text", "Place finger on the scanner to start.");
         }
         catch
         {
             Dejitaru.SetControlProperty(this, lstatus, "Text", "Can't start capture.");
         }
     }
 }
Beispiel #5
0
 private void Init()
 {
     Enroller = new DPFP.Processing.Enrollment();
     try
     {
         Capturer = new DPFP.Capture.Capture();
         if (null != Capturer)
         {
             Capturer.EventHandler = this;
         }
         else
         {
             Dejitaru.SetControlProperty(this, lstatus, "Text", "Can't initiate capture operation.");
         }
     }
     catch
     {
         Dejitaru.SetControlProperty(this, lstatus, "Text", "Can't initiate capture operation.");
     }
 }
Beispiel #6
0
 private void SetControl()
 {
     if (gpurpose == DPFP.Processing.DataPurpose.Enrollment)
     {
         Dejitaru.SetControlProperty(this, prbenroll, "Visible", true);
         Dejitaru.SetControlProperty(this, lblnote, "Location", new Point(53, 470));
         Dejitaru.SetControlProperty(this, lblnote, "Visible", true);
         Dejitaru.SetControlProperty(this, lblnote, "Text", "Note: Requires four fingerprint samples for Enrollment.");
     }
     else if (gpurpose == DPFP.Processing.DataPurpose.Verification)
     {
         Dejitaru.SetControlProperty(this, prbenroll, "Visible", false);
         Dejitaru.SetControlProperty(this, lblnote, "Location", new Point(53, 440));
         Dejitaru.SetControlProperty(this, lblnote, "Visible", true);
         Dejitaru.SetControlProperty(this, lblnote, "Text", "Place your index finger on the scanner to verify your identity.");
     }
     else
     {
         Dejitaru.SetControlProperty(this, prbenroll, "Visible", false);
         Dejitaru.SetControlProperty(this, lblnote, "Visible", false);
         Dejitaru.SetControlProperty(this, lblnote, "Text", "");
     }
 }
Beispiel #7
0
        private void Process(DPFP.Sample sample, DPFP.Processing.DataPurpose purpose)
        {
            if (purpose == DPFP.Processing.DataPurpose.Enrollment)
            {
                DPFP.FeatureSet features = ExtractFeatures(sample, purpose);
                if (features != null)
                {
                    try
                    {
                        Enroller.AddFeatures(features);
                    }
                    finally
                    {
                        switch (Enroller.TemplateStatus)
                        {
                        case DPFP.Processing.Enrollment.Status.Ready:

                            byte[] fpsample = new byte[0];
                            Enroller.Template.Serialize(ref fpsample);
                            Dejitaru.progress += 1;
                            Dejitaru.SetControlProperty(this, prbenroll, "Value", Dejitaru.progress);
                            Dejitaru.progress = 0;
                            Enroller.Clear();
                            gpurpose = DPFP.Processing.DataPurpose.Unknown;
                            Dejitaru.SerializetoDB(fpsample, lstatus, this);
                            Stop();
                            break;

                        case DPFP.Processing.Enrollment.Status.Failed:

                            Dejitaru.SetControlProperty(this, lstatus, "Text", "Enrollment failed.");

                            Start();
                            break;

                        case DPFP.Processing.Enrollment.Status.Insufficient:

                            Dejitaru.progress += 1;
                            Dejitaru.SetControlProperty(this, prbenroll, "Value", Dejitaru.progress);

                            Dejitaru.SetControlProperty(this, lstatus, "Text", "Needing more samples for enrollment.Please scan more.");

                            break;

                        case DPFP.Processing.Enrollment.Status.Unknown:
                            Dejitaru.SetControlProperty(this, lstatus, "Text", "Unknown");

                            break;
                        }
                    }
                }
            }
            if (purpose == DPFP.Processing.DataPurpose.Verification)
            {
                DPFP.FeatureSet features = ExtractFeatures(sample, purpose);
                string          rhandler = "";
                if (features != null)
                {
                    //DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();

                    //Verifier.Verify(features, template, ref result);

                    string[] results = VerifyDB(features);

                    if (results[0].Equals("true"))
                    {
                        rhandler = "Match found. \n\n";
                        for (int i = 1; i < results.Length; i++)
                        {
                            rhandler = rhandler + " " + results[i] + "\n";
                        }
                    }
                    else
                    {
                        rhandler = "No match found.";
                    }
                    Dejitaru.SetControlProperty(this, lstatus, "Text", rhandler);
                }
            }
        }