protected virtual void Process(DPFP.Sample Sample)
        {
            DrawPicture(FingerPrintUtility.ConvertSampleToBitmap(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();
            }
        }
Пример #2
0
        protected virtual void Process(DPFP.Sample Sample)
        {
            DrawPicture(FingerPrintUtility.ConvertSampleToBitmap(Sample));

            try
            {
                nom = 0;
                DPFP.FeatureSet features = FingerPrintUtility.ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);
                SetPanelColor(Color.FromArgb(64, 69, 76));
                SetPrompt("Detectando...");
                if (features != null)
                {
                    // Compare the feature set with our template
                    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("Verificado");
                            resultado = nom;
                            Stop();
                        }
                        nom++;
                    }
                    this.IsVerificationComplete = verified;
                    if (!verified)
                    {
                        SetPrompt("Incorrecta");
                    }
                }
                else
                {
                    SetPrompt("Fallando");
                }
            }
            catch (Exception e)
            {
                SetPrompt("Error!");
            }
        }
Пример #3
0
        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("Verified.");
                        Stop();
                    }
                }
                this.IsVerificationComplete = verified;
                if (!verified)
                {
                    SetPrompt("Finger print not recognised.");
                }
            }
            else
            {
                SetPrompt("Can't recognize as a fingerprint.");
            }
            //}
            //catch (Exception)
            //{
            //    SetPrompt("Error!");
            //}
        }