Пример #1
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)
 {
     try
     {
         TrueBitmap = ConvertSampleToBitmap(Sample);
         DrawPicture(TrueBitmap);
     }
     catch (Exception ex)
     {
     }
 }
Пример #3
0
 protected void Process(DPFP.Sample Sample)
 {
     try
     {
         MemSample = Sample;
         DrawPicture(ConvertSampleToBitmap(Sample));
     }
     catch (Exception ex)
     {
         MakeReport(ex.Message);
     }
 }
Пример #4
0
        public static byte[] ToImageBytes(this DPFP.Sample Sample)
        {
            DPFP.Capture.SampleConversion Convertor = new DPFP.Capture.SampleConversion();
            Bitmap bitmap = null;

            Convertor.ConvertToPicture(Sample, ref bitmap);

            using (MemoryStream ms = new MemoryStream())
            {
                bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
                return(ms.ToArray());
            }
        }
Пример #5
0
        public void OnComplete(object Capture, string ReaderSerialNumber, DPFP.Sample Sample)
        {
            MakeReport("The fingerprint sample was captured.");
            SetPrompt("Scan the same fingerprint again.");

            if (action == "verify old owner")
            {
                ProcessVerify(Sample, Owners);
            }
            else
            {
                ProcessVerify(Sample, LLtemplates);
            }
        }
Пример #6
0
        public static bool Verify(DPFP.Template template, DPFP.Sample sample)
        {
            var verificator = new DPFP.Verification.Verification();

            DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
            // Process the sample and create a feature set for verification.
            DPFP.FeatureSet features = ExtractFeatures(sample, DPFP.Processing.DataPurpose.Verification);
            if (features != null)
            {
                // Compare the feature set with our template
                verificator.Verify(features, template, ref result);
            }
            return(result.Verified);
        }
Пример #7
0
        protected void ProcessVerify(DPFP.Sample Sample)
        {
            try
            {
                // Draw fingerprint sample image.
                DrawPicture(ConvertSampleToBitmap(Sample));

                // Process the sample and create a feature set for the enrollment purpose.
                DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);

                // Check quality of the sample and start verification if it's good
                // TODO: move to a separate task
                if (features != null)
                {
                    DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                    bool found = false;
                    int  index = 0;
                    // Compare the feature set with each of our template
                    foreach (var llt in Owners)
                    {
                        Verificator.Verify(features, llt, ref result);

                        if (result.Verified)
                        {
                            found = true;
                            using (var db = new LandxEntities())
                            {
                                Dlandlord = db.People.Find(psnId);
                            }
                            MakeReport("The fingerprint was VERIFIED.");
                            displayMsg("Welcome " + Dlandlord.ApplicantsFullname);
                            enableNextFP();

                            break;
                        }
                        index++;
                    }
                    if (!found)
                    {
                        MakeReport("The fingerprint was NOT VERIFIED.");
                    }
                }

                Capturer.StartCapture();
            }
            catch (Exception ex)
            {
                MessageBox.Show("An error occured while comparing with fingerprint database. \n\r\n\r" + ex.ToString());
            }
        }
Пример #8
0
 protected void Process(DPFP.Sample Sample)
 {
     try
     {
         MemSample = Sample;
         // Draw fingerprint sample image.
         DrawPicture(ConvertSampleToBitmap(Sample));
         EnabledDisabledButton(true);
     }
     catch (Exception ex)
     {
         MakeReport(ex.Message);
     }
 }
Пример #9
0
        private void ClearFields()
        {
            if (picCheck.InvokeRequired)
            {
                picCheck.BeginInvoke((MethodInvoker) delegate
                {
                    picCheck.Visible = false;
                });
            }

            if (picFingerprint.InvokeRequired)
            {
                picFingerprint.BeginInvoke((MethodInvoker) delegate
                {
                    picFingerprint.Image = null;
                });
            }

            if (lblPunchDateTimeResult.InvokeRequired)
            {
                lblPunchDateTimeResult.BeginInvoke((MethodInvoker) delegate
                {
                    lblPunchDateTimeResult.Text = "";
                });
            }
            if (lblInstructions.InvokeRequired)
            {
                lblInstructions.BeginInvoke((MethodInvoker) delegate
                {
                    lblInstructions.Text = "";
                });
            }
            if (lblStaffMemberNameResult.InvokeRequired)
            {
                lblStaffMemberNameResult.BeginInvoke((MethodInvoker) delegate
                {
                    lblStaffMemberNameResult.Text = "";
                });
            }
            if (lblPunchTypeResult.InvokeRequired)
            {
                lblPunchTypeResult.BeginInvoke((MethodInvoker) delegate
                {
                    lblPunchTypeResult.Text = "";
                });
            }

            MemSample = null;
        }
Пример #10
0
 protected DPFP.FeatureSet extraercaracteristicas(DPFP.Sample Sample, DPFP.Processing.DataPurpose Porpuse)
 {
     DPFP.Processing.FeatureExtraction extractor    = new DPFP.Processing.FeatureExtraction();
     DPFP.Capture.CaptureFeedback      alimentacion = DPFP.Capture.CaptureFeedback.None;
     DPFP.FeatureSet caracteristicas = new DPFP.FeatureSet();
     extractor.CreateFeatureSet(Sample, Porpuse, ref alimentacion, ref caracteristicas);
     if ((alimentacion == DPFP.Capture.CaptureFeedback.Good))
     {
         return(caracteristicas);
     }
     else
     {
         return(null /* TODO Change to default(_) if this is not a reference type */);
     }
 }
Пример #11
0
 protected DPFP.FeatureSet ExtractFeatures(DPFP.Sample Sample, DPFP.Processing.DataPurpose Purpose)
 {
     DPFP.Processing.FeatureExtraction Extractor = new DPFP.Processing.FeatureExtraction();
     DPFP.Capture.CaptureFeedback      feedback  = DPFP.Capture.CaptureFeedback.None;
     DPFP.FeatureSet features = new DPFP.FeatureSet();
     Extractor.CreateFeatureSet(Sample, Purpose, ref feedback, ref features);
     if (feedback == DPFP.Capture.CaptureFeedback.Good)
     {
         return(features);
     }
     else
     {
         return(null);
     }
 }
Пример #12
0
 public static DPFP.FeatureSet ExtractFeatures(DPFP.Sample Sample, DPFP.Processing.DataPurpose Purpose)
 {
     DPFP.Processing.FeatureExtraction Extractor = new DPFP.Processing.FeatureExtraction();  // Create a feature extractor
     DPFP.Capture.CaptureFeedback      feedback  = DPFP.Capture.CaptureFeedback.None;
     DPFP.FeatureSet features = new DPFP.FeatureSet();
     Extractor.CreateFeatureSet(Sample, Purpose, ref feedback, ref features);            // TODO: return features as a result?
     if (feedback == DPFP.Capture.CaptureFeedback.Good)
     {
         return(features);
     }
     else
     {
         return(null);
     }
 }
Пример #13
0
        protected virtual void Process(DPFP.Sample Sample)
        {
            Bitmap BMP = ConvertSampleTobitmap(Sample);

            DrawPicture(BMP);
            DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);

            if (features != null)
            {
                // Compare the feature set with our template
                DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                Verificator.Verify(features, Template, ref result);
                //UpdateStatus(result.FARAchieved);
                Verificador(result.Verified);
            }
        }
Пример #14
0
        public static DPFP.FeatureSet ExtractFeatures(this DPFP.Sample Sample, DPFP.Processing.DataPurpose Purpose)
        {
            var Extractor = new DPFP.Processing.FeatureExtraction();
            var feedback  = DPFP.Capture.CaptureFeedback.None;
            var features  = new DPFP.FeatureSet();

            Extractor.CreateFeatureSet(Sample, Purpose, ref feedback, ref features);
            if (feedback == DPFP.Capture.CaptureFeedback.Good)
            {
                return(features);
            }
            else
            {
                return(null);
            }
        }
Пример #15
0
        /// <summary>
        /// Se crea metodo para enviar el proceso de detectar el finger print
        /// </summary>
        /// <param name="Sample"></param>
        public async Task ProcessAsync(DPFP.Sample Sample)
        {
            //Process(Sample);

            // Process the sample and create a feature set for the enrollment purpose.
            DPFP.FeatureSet features = serv.ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Enrollment);

            // Check quality of the sample and add to enroller if it's good
            if (features != null)
            {
                try
                {
                    MakeReport("The fingerprint feature set was created.");
                    Enroller.AddFeatures(features);     // Add feature set to template.
                }
                finally
                {
                    UpdateStatus();

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

                        OnTemplate(Enroller.Template);
                        //Register64 = Convert.ToBase64String(Enroller.Template.Bytes);
                        SetPrompt("Click Close, and then click Fingerprint Verification.");
                        GuardarRegistroAsync();
                        Stop();
                        CrearCuenta();
                        trTimer.Enabled = true;
                        sqlin.HabilitarBiometricoNO();
                        //Enroller.Clear();
                        break;

                    case DPFP.Processing.Enrollment.Status.Failed:      // report failure and restart capturing
                        Enroller.Clear();
                        Stop();
                        UpdateStatus();
                        OnTemplate(null);
                        Start();
                        break;
                    }
                }
            }
        }
Пример #16
0
        protected virtual void Process(DPFP.Sample Sample /*, DPFP.Processing.DataPurpose Purpose*/)
        {
            DrawPicture(FingerPrintUtility.ConvertSampleToBitmap(Sample));
            try
            {
                DPFP.FeatureSet features = FingerPrintUtility.ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Enrollment);

                if (features != null)
                {
                    try
                    {
                        Enroller.AddFeatures(features);
                    }
                    catch
                    {
                        MessageBox.Show("Template error");
                    }
                    finally
                    {
                        UpdateSamplesNeeded();
                        switch (Enroller.TemplateStatus)
                        {
                        case DPFP.Processing.Enrollment.Status.Ready:
                            OnTemplateCollect(Enroller.Template);
                            Stop();
                            MessageBox.Show("Enrolled Successfuly");
                            break;

                        case DPFP.Processing.Enrollment.Status.Failed:
                            Enroller.Clear();
                            Stop();
                            OnTemplateCollect(null);
                            UpdateSamplesNeeded();
                            Start();
                            MessageBox.Show("Enroller Failed");
                            break;
                        }
                    }
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Cant recognize as a fingerprint.");
                UpdateSamplesNeeded();
            }
        }
Пример #17
0
        public DPFP.Template ConvertRawBmpAsTemplate(Bitmap RawBmp, DataPurpose ProcessPurpose = DataPurpose.Enrollment, short VertDpi = 700, short HorDpi = 700)
        {
            VariantConverter VConverter;

            Enroller = new DPFP.Processing.Enrollment();
            RawBmp   = EncodeBitmap(RawBmp, VertDpi, HorDpi);
            try
            {
                // converts raw image to dpSample using DFC 2.0---------------------------------------
                // encode the bmp variable using the bitmap Loader
                BitmapLoader BmpLoader = new BitmapLoader(RawBmp, (int)RawBmp.HorizontalResolution, (int)RawBmp.VerticalResolution);
                BmpLoader.ProcessBitmap();
                // return the required result
                inputData = BmpLoader.RawData;
                inpRaw    = BmpLoader.DPInputParam;
                // dispose the object
                BmpLoader.Dispose();

                // start the conversion process
                VConverter = new VariantConverter(VariantConverter.OutputType.dp_sample, DataType.RawSample, inpRaw, inputData, false);
                MemoryStream DStream = new MemoryStream(VConverter.Convert());
                DPsample = new DPFP.Sample(DStream);
                // DPsample = DirectCast(VConverter.Convert(), DPFP.Sample)

                // converts dpSample to DPFeatures using the OTW'''''''''''''''''''''''''''''''''''''''
                DPFeatures = ExtractFeatures(DPsample, ProcessPurpose);
                // convert DPfeatures to ISO FMD using the DFC 2.0'''''''''''''''''''''''''''''''''''''''
                byte[] SerializedFeatures = null;
                DPFeatures.Serialize(ref SerializedFeatures); // serialized features into the array of bytes
                ISOFMD = DigitalPersona.Standards.Converter.Convert(SerializedFeatures, DigitalPersona.Standards.DataType.DPFeatureSet, DataType.ISOFeatureSet);

                // convert ISO FMD to DPTemplate using DFC 2.0'''''''''''''''''''''''''''''''''''''''
                byte[] DPTemplateData = DigitalPersona.Standards.Converter.Convert(ISOFMD, DigitalPersona.Standards.DataType.ISOTemplate, DataType.DPTemplate);
                // deserialize data to Template
                DPTemplate = new DPFP.Template();
                DPTemplate.DeSerialize(DPTemplateData); // required for database purpose
                                                        // ============================================================================
                DStream.Close();
                return(DPTemplate);
            }
            catch (Exception ex)
            {
                return(null /* TODO Change to default(_) if this is not a reference type */);
            }
        }
Пример #18
0
        private void Procces(DPFP.Sample Sample)
        {
            Bitmap BMP = ConvertSampleTobitmap(Sample);

            DrawPicture(BMP);
            DPFP.FeatureSet Features = ExtractFeaTures(Sample, DPFP.Processing.DataPurpose.Enrollment);
            if (Features != null)
            {
                try
                {
                    Enroller.AddFeatures(Features);
                }
                catch
                {
                    MessageBox.Show("Error de guardado");
                    Enroller.Clear();
                    Stop();
                    ActualizarStado();
                    OnTemplate(null);
                    Start();
                }
                finally
                {
                    ActualizarStado();
                    switch (Enroller.TemplateStatus)
                    {
                    case DPFP.Processing.Enrollment.Status.Ready:
                        OnTemplate(Enroller.Template);
                        //Anunciar("Dedo guardado");
                        //MessageBox.Show("Dedo Guardado");
                        Stop();
                        break;

                    case DPFP.Processing.Enrollment.Status.Failed:
                        Enroller.Clear();
                        Stop();
                        ActualizarStado();
                        OnTemplate(null);
                        Start();
                        break;
                    }
                }
            }
        }
Пример #19
0
        public void Process(DPFP.Sample Sample)
        {
            // Process the sample and create a feature set for the enrollment purpose.
            DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);

            // Check quality of the sample and start verification if it's good
            // TODO: move to a separate task
            if (features != null)
            {
                // Compare the feature set with our template
                DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                foreach (var item in funcionarios)
                {
                    if (item.Digital != null)
                    {
                        Template = new Template();
                        Template.DeSerialize(item.Digital);
                        Verificator.Verify(features, Template, ref result);
                        if (result.Verified)
                        {
                            funcionario         = item;
                            impressaoLocalizada = true;
                            return;
                        }
                    }
                }

                if (result.Verified)
                {
                    updateStatus("Impressão digital localizada com sucesso.");
                }
                else
                {
                    impressaoLocalizada = false;
                    updateStatus("Impressão digital não localizada. \nTente novamente.");
                    this.Invoke(new Function(delegate() { limparTela(); }));
                    Application.DoEvents();
                    cp.StopCapture();
                    cp = new DPFP.Capture.Capture();
                    cp.StartCapture();
                    cp.EventHandler = this;
                }
            }
        }
Пример #20
0
        /// <summary>
        /// Ejecuta el proceso de incripcion de la huella
        /// </summary>
        /// <param name="Sample"></param>
        private string Process(DPFP.Sample Sample)
        {
            string state = "";

            DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Enrollment);
            // Check quality of the sample and add to enroller if it's good
            if (features != null)
            {
                try
                {
                    Enroller.AddFeatures(features);     // Add feature set to template.
                    state = "procces";
                } catch (DPFP.Error.SDKException e) {
                    Enroller.Clear();
                    this.Pause();
                    Start();

                    return(state = "failed");
                }
            }
Пример #21
0
        protected override void Process(DPFP.Sample Sample)
        {
            base.Process(Sample);

            // Process the sample and create a feature set for the enrollment purpose.
            DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Enrollment);

            // Check quality of the sample and add to enroller if it's good
            if (features != null)
            {
                try
                {
                    MakeReport("The fingerprint feature set was created.");
                    Enroller.AddFeatures(features);     // Add feature set to template.
                }

                finally
                {
                    UpdateStatus();

                    // Check if template has been created.
                    switch (Enroller.TemplateStatus)
                    {
                    case DPFP.Processing.Enrollment.Status.Ready:       // report success and stop capturing
                        //OnTemplate(Enroller.Template);
                        base.OnTemplate(Enroller.Template);
                        SetPrompt("Click Close, and then click Fingerprint Verification.");
                        Stop();
                        break;

                    case DPFP.Processing.Enrollment.Status.Failed:      // report failure and restart capturing
                        Enroller.Clear();
                        Stop();
                        UpdateStatus();
                        //OnTemplate(null);
                        Start();
                        break;
                    }
                }
            }
        }
Пример #22
0
        public static void ShowFP(DPFP.Sample sample, PictureBox pb, Form form)
        {
            DPFP.Capture.SampleConversion Converter = new DPFP.Capture.SampleConversion();
            Bitmap bmp = null;

            Converter.ConvertToPicture(sample, ref bmp);


            if (bmp != null)
            {
                int   w = bmp.Width;
                int   h = bmp.Height;
                Color p;

                for (int y = 0; y < h; y++)
                {
                    for (int x = 0; x < w; x++)
                    {
                        p = bmp.GetPixel(x, y);
                        int a = p.A;
                        int g = p.G;


                        int px = 0;

                        if (g > 120)
                        {
                            bmp.SetPixel(x, y, Color.FromArgb(255, px, px, px));
                        }
                        else
                        {
                            //bmp.SetPixel(x, y, Color.FromArgb(255, px, 220, px));
                            bmp.SetPixel(x, y, Color.FromArgb(255, 0, 174, 219));
                            // bmp.SetPixel(x, y, Color.FromArgb(255, 255, 255, 255));
                        }
                    }
                }
            }

            SetControlProperty(form, pb, "Image", bmp);
        }
Пример #23
0
        protected void Process2(DPFP.Sample Sample)
        {
            Process(Sample);

            // Process the sample and create a feature set for the enrollment purpose.
            DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);

            // Check quality of the sample and start verification if it's good
            // TODO: move to a separate task
            if (features != null)
            {
                // Compare the feature set with our template
                DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();

                DPFP.Template template = new DPFP.Template();
                Stream        stream;



                foreach (var emp in contexto.HUELLASCLIENTES)
                {
                    stream   = new MemoryStream(emp.HUELLA);
                    template = new DPFP.Template(stream);

                    Verificator.Verify(features, template, ref result);
                    UpdateStatus(result.FARAchieved);
                    if (result.Verified)
                    {
                        Int64 ID = emp.ID;
                        this.PID = ID;
                        SetStatus(Convert.ToString(ID));
                        Regis(ID);
                        //dtgLista.DataSource = LisRegist(UsserID);
                        //Listar();
                        //MakeReport("The fingerprint was VERIFIED. " + emp.Nombre);
                        break;
                    }
                }
            }
        }
Пример #24
0
        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();
            }
        }
Пример #25
0
 protected DPFP.FeatureSet ExtractFeatures(DPFP.Sample Sample, DPFP.Processing.DataPurpose Purpose)
 {
     try
     {
         DPFP.Processing.FeatureExtraction extractor = new DPFP.Processing.FeatureExtraction();        // Create a feature extractor
         DPFP.Capture.CaptureFeedback      feedback  = DPFP.Capture.CaptureFeedback.None;
         DPFP.FeatureSet features = new DPFP.FeatureSet();
         extractor.CreateFeatureSet(Sample, Purpose, ref feedback, ref features); // TODO: return features as a result?
         if ((feedback == DPFP.Capture.CaptureFeedback.Good))
         {
             return(features);
         }
         else
         {
             return(null /* TODO Change to default(_) if this is not a reference type */);
         }
     }
     catch (Exception ex)
     {
         throw new Exception("Error Extracting Features");
     }
 }
        protected override void Process(DPFP.Sample Sample)
        {
            base.Process(Sample);


            DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);

            var FileReader = new CargaFileHandler();

            if (features != null)
            {
                var biometrias = FileReader.ReadBiometriasFile("digitalPersona");
                var chaves     = new List <string>();
                foreach (var bio in biometrias)
                {
                    Template t = new Template();

                    t.DeSerialize(bio.GetBytes());

                    DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                    Verificator.Verify(features, t, ref result);
                    if (result.Verified)
                    {
                        chaves.Add(bio.Chave);
                    }
                }

                foreach (var chave in chaves)
                {
                    biometrias.RemoveAll(x => x.Chave == chave);
                }
                if (biometrias.Count > 0)
                {
                    FileReader.SavaBiometriasFile(biometrias, "digitalPersona", true);
                }
                OnDelete?.Invoke(chaves);
            }
        }
Пример #27
0
        public void Process(DPFP.Sample Sample)
        {
            capturador.Process(Sample);

            DPFP.FeatureSet features = capturador.ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Enrollment);

            if (features != null)
            {
                try
                {
                    Enroller.AddFeatures(features);             // Add feature set to template.
                }
                finally
                {
                    DrawPicture(capturador.ConvertSampleToBitmap(Sample));
                    UpdateStatus();
                    // Check if template has been created.
                    switch (Enroller.TemplateStatus)
                    {
                    case DPFP.Processing.Enrollment.Status.Ready:       // report success and stop capturing
                        //OnTemplate(Enroller.Template);
                        //SetPrompt("Click Close, and then click Fingerprint Verification.");
                        estado("Click Close, and then click Fingerprint Verification.");
                        capturador.deter_captura();
                        break;

                    case DPFP.Processing.Enrollment.Status.Failed:      // report failure and restart capturing
                        Enroller.Clear();
                        capturador.deter_captura();
                        UpdateStatus();
                        OnTemplate(null);
                        capturador.iniciar_captura();
                        break;
                    }
                }
            }
        }
Пример #28
0
        protected void Procesar(DPFP.Sample Sample)
        {
            DPFP.FeatureSet caracteristicas = extraercaracteristicas(Sample, DPFP.Processing.DataPurpose.Enrollment);
            if ((caracteristicas != null))
            {
                try
                {
                    Enroller.AddFeatures(caracteristicas);
                }
                finally
                {
                    StringBuilder text = new StringBuilder();
                    text.AppendFormat("Necesitas pasar el dedo {0} veces", Enroller.FeaturesNeeded);
                    mostrarveces(text.ToString());
                    switch (Enroller.TemplateStatus)
                    {
                    case DPFP.Processing.Enrollment.Status.Ready:
                    {
                        template = Enroller.Template;
                        PararCpatura();
                        this.Dispatcher.BeginInvoke((Action)(() => { btonguardar.IsEnabled = true; }));
                        this.Dispatcher.BeginInvoke((Action)(() => { btonguardar.Visibility = Visibility.Visible; }));
                        //btonguardar.IsEnabled = true;
                        break;
                    }

                    case DPFP.Processing.Enrollment.Status.Failed:
                    {
                        Enroller.Clear();
                        PararCpatura();
                        IniciarCaptura();
                        break;
                    }
                    }
                }
            }
        }
Пример #29
0
        public void SetFeaturesEnrollment(DPFP.Sample sample)
        {
            DPFP.FeatureSet featureSet = CreateFeatureSet(sample, DPFP.Processing.DataPurpose.Enrollment);
            if (featureSet != null)
            {
                try
                {
                    enrollment.AddFeatures(featureSet);
                }
                catch (Exception e)
                {
                    MessageBox.Show("ERROR AL EXTRAER LAS CARACTERISTICAS DE LA HUELLA");
                }
                finally
                {
                    StringBuilder stringBuilder = new StringBuilder();
                    stringBuilder.AppendFormat("Necesitas pasar el dedo {0} veces", enrollment.FeaturesNeeded);
                    SetLabelCount(stringBuilder.ToString());

                    switch (enrollment.TemplateStatus)
                    {
                    case DPFP.Processing.Enrollment.Status.Ready:
                        template = enrollment.Template;
                        EnableButtonSave();
                        StopCapture();
                        break;

                    case DPFP.Processing.Enrollment.Status.Failed:
                        enrollment.Clear();
                        StopCapture();
                        InitCapture();
                        break;
                    }
                }
            }
        }
Пример #30
0
        protected void Process(DPFP.Sample Sample)
        {
            ProcesarMuestra(Sample);

            // Este método es usado por el SDK para ir generando una plantilla completa, a partir de las 4 muestras que
            // pide, y va obteniendo sus "features"
            DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Enrollment);

            // Se verifica que la calidad de la muestra sea buena
            if (features != null)
            {
                try {
                    MakeReport("The fingerprint feature set was created.");
                    Enroller.AddFeatures(features);             // Add feature set to template.
                    pbMuestras.Invoke(new MethodInvoker(delegate { pbMuestras.Value += 25; }));
                    success = true;
                } catch (Exception ex) {
                    //MessageBox.Show("Ocurrió un error inesperado, por favor vuelva a intentarlo.", "Error Inesperado", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    lblEstatus.Invoke(new MethodInvoker(delegate { lblEstatus.Text = "Error, vuelva a escanear"; }));
                    success = false;
                    pbMuestras.Invoke(new MethodInvoker(delegate { pbMuestras.Value = 0; }));
                    return;
                }
            }
Пример #31
0
 protected void Process(DPFP.Sample Sample)
 {
     try
     {
         MemSample = Sample;
         // Draw fingerprint sample image.
         DrawPicture(ConvertSampleToBitmap(Sample));
         EnabledDisabledButton(true);
     }
     catch (Exception ex)
     {
         MakeReport(ex.Message);
     }
 }