Ejemplo n.º 1
0
        protected virtual void Process(DPFP.Sample Sample)
        {
            DrawPicture(FingerPrintUtility.ConvertSampleToBitmap(Sample));
            showed_sample = Sample;
            try
            {
                DPFP.FeatureSet features = FingerPrintUtility.ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Enrollment);
                if (features != null)
                {
                    try
                    {
                        SetPrompt("The fingerprint feature set was created.");
                        SetPanelColor(System.Drawing.SystemColors.Control);
                        Enroller.AddFeatures(features);         // Add feature set to template.
                    }
                    catch (SDKException ex)
                    {
                        SetPrompt(ex.Message);
                    }
                    finally
                    {
                        UpdateSamplesNeeded();

                        // Check if template has been created.
                        switch (Enroller.TemplateStatus)
                        {
                        case DPFP.Processing.Enrollment.Status.Ready:           // report success and stop capturing
                            OnTemplateCollect(Enroller.Template);

                            SetPrompt("Done.");
                            Stop();
                            break;

                        case DPFP.Processing.Enrollment.Status.Failed:          // report failure and restart capturing
                            Enroller.Clear();
                            Stop();
                            UpdateSamplesNeeded();
                            OnTemplateCollect(null);
                            Start();
                            break;
                        }
                    }
                }
                else
                {
                    SetPrompt("Can't recognize as a fingerprint.");
                    UpdateSamplesNeeded();
                }
            }
            catch (Exception)
            {
                SetPrompt("Can't recognize as a fingerprint.");
                UpdateSamplesNeeded();
            }
        }
Ejemplo n.º 2
0
        private void Fingerprint_scan_Click(object sender, EventArgs e)
        {
            Registration reg = new Registration();

            if (reg.ShowDialog() == DialogResult.OK)
            {
                this.sample      = reg.fingerPrintRegUserControl.showed_sample;
                this.fingerprint = reg.fingerPrintRegUserControl.FingerPrint;
                DrawPicture(FingerPrintUtility.ConvertSampleToBitmap(this.sample));
            }
        }
        protected virtual void Process(DPFP.Sample Sample)
        {
            DrawPicture(FingerPrintUtility.ConvertSampleToBitmap(Sample));

            //try
            //{
            DPFP.FeatureSet features = FingerPrintUtility.ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);
            SetPanelColor(System.Drawing.SystemColors.Control);
            SetPrompt("Verifying...");
            if (features != null)
            {
                // Compare the feature set with our template
                bool verified = false;
                foreach (DPFP.Template template in this.Samples.Keys)
                {
                    DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                    Verificator.Verify(features, template, ref result);
                    if (result.Verified)
                    {
                        this.VerifiedObject = Samples[template];
                        verified            = true;
                        SetPrompt("Logged In");
                        //Stop();
                    }
                }
                this.IsVerificationComplete = verified;
                if (!verified)
                {
                    SetPrompt("Finger print not recognised.");
                }
            }
            else
            {
                SetPrompt("Can't recognize as a fingerprint.");
            }
            //}
            //catch (Exception)
            //{
            //    SetPrompt("Error!");
            //}
        }