Exemplo n.º 1
0
        protected virtual void Process(DPFP.Sample Sample)
        {
            DrawPicture(ConvertSampleToBitmap(Sample));
            DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);

            if (features != null)
            {
                byte[] bytes = new byte[1632];
                features.Serialize(ref bytes);

                for (int x = 0; x < List_Usuarios.Count; x++)
                {
                    DPFP.Template templeate = new DPFP.Template();
                    templeate.DeSerialize(List_Usuarios[x].fingerPrint);

                    DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                    Verificator.Verify(features, templeate, ref result);

                    if (result.Verified)
                    {
                        int id_usuario = List_Usuarios[x].id_Cliente;
                        var usuario    = (from cliente in contexto.tb_Usuarios where cliente.id_usuario == id_usuario select cliente).Single();
                        MessageBox.Show("VERIFICADO  " + usuario.nombre_usuario);
                        return;
                    }
                }

                MessageBox.Show("NO ENCONTRADO");
            }
        }
Exemplo n.º 2
0
        protected virtual void Process(DPFP.Sample Sample)
        {
            DrawPicture(ConvertSampleToBitmap(Sample));
            DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);

            if (features != null)
            {
                byte[] bytes = new byte[1632];
                features.Serialize(ref bytes);

                for (int x = 0; x < List_Usuarios.Count; x++)
                {
                    DPFP.Template templeate = new DPFP.Template();
                    templeate.DeSerialize(List_Usuarios[x].fingerPrint);

                    DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                    Verificator.Verify(features, templeate, ref result);


                    if (result.Verified)
                    {
                        _idCliente = List_Usuarios[x].id_Cliente;

                        return;
                    }
                }

                //videoSourcePlayer1.BackgroundImage = Properties.Resources.Desconocido;
                MessageBox.Show("Cliente no encontrado", "Information", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }
Exemplo n.º 3
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.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();
                Verificator.Verify(features, Template, ref result);
                UpdateStatus(result.FARAchieved);
                if (result.Verified)
                {
                    MakeReport("The fingerprint was VERIFIED.");
                }
                else
                {
                    MakeReport("The fingerprint was NOT VERIFIED.");
                }
            }
        }
        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");


                foreach (var bio in biometrias)
                {
                    DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                    try
                    {
                        Template t = new Template();
                        t.DeSerialize(bio.GetBytes());

                        Verificator.Verify(features, t, ref result);
                    }
                    catch { OnVerify?.Invoke(false, ""); return; };
                    if (result.Verified)
                    {
                        OnVerify?.Invoke(true, bio.Chave);
                        return;
                    }
                }
                OnVerify?.Invoke(false, "");
            }
        }
        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.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();
                Verificator.Verify(features, Template, ref result);
                UpdateStatus(result.FARAchieved);
                if (result.Verified)
                {
                    MakeReport("A impressão digital foi verificada.");
                    MetroFramework.MetroMessageBox.Show(this, "A impressão digital foi verificada com sucesso.", "Verificação biométrica", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Question);
                }
                else
                {
                    MakeReport("A impressão digital não foi verificada.");
                    MetroFramework.MetroMessageBox.Show(this, "A impressão digital não encontrada. Tente novamente.", "Verificação biométrica", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Hand);
                }
            }
        }
		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.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();
                string[] flist = Directory.GetFiles("c:/finger");
                int mx = flist.Length;
                int cnt = 0;
                bool found = false;
               
                 DPFP.Template templates;
                while (cnt < mx && !found)
                {
                   // MessageBox.Show(flist[cnt]);
                    using (FileStream fs = File.OpenRead(flist[cnt]))
                    {
                         templates = new DPFP.Template(fs);
                        Verificator.Verify(features, templates, ref result);
                        UpdateStatus(result.FARAchieved);
                    }
                    if (result.Verified)
                    {
                        found = true;
                        FileInfo nfo = new FileInfo(flist[cnt]);
                        fname = nfo.Name;                        
                        break;
                    }
                    else
                    {
                        found = false;
                        cnt++;
                    }
                }
              
            
                    if (found)
                    {
                        MakeReport("The fingerprint was VERIFIED. "+fname);
                        MessageBox.Show("Verified!!");
                        
                    
                        
                    }
                    else
                    {
                        MakeReport("The fingerprint was NOT VERIFIED.");
                        MessageBox.Show("Not Verified!!");
                    }
                
            }
		}
Exemplo n.º 7
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.Verification);

            // Check quality of the sample and start verification if it's good
            // TODO: move to a separate task
            if (features != null)
            {
                DbConnection.checkConnection();
                lst = getbyet();
                DPFP.FeatureSet featur;
                for (int i = 0; i < lst.Count; i++)
                {
                    Stream      s      = new MemoryStream(lst[i].Prints);
                    DPFP.Sample sample = new DPFP.Sample(s);
                    featur = ExtractFeatures(sample, DPFP.Processing.DataPurpose.Enrollment);
                    enrol.AddFeatures(featur);
                    if (enrol.TemplateStatus == DPFP.Processing.Enrollment.Status.Ready)
                    {
                        // Compare the feature set with our template
                        DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                        Verificator.Verify(features, enrol.Template, ref result);
                        UpdateStatus(result.FARAchieved);
                        if (result.Verified)
                        {
                            cnic = lst[i].CNIC;
                            this.DialogResult = System.Windows.Forms.DialogResult.OK;
                            base.Stop();
                            this.Dispose();
                            break;
                        }
                        else
                        {
                            cnic = "";
                            MakeReport("The fingerprint was NOT VERIFIED.");
                            enrol.Clear();
                        }
                    }
                }
            }
        }
Exemplo n.º 8
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.Verification);

            // Check quality of the sample and start verification if it's good
            // TODO: move to a separate task
            if (features != null)
            {
                byte[] bytes = new byte[1632];
                features.Serialize(ref bytes);

                //"0X" + BitConverter.ToString( bytes ).Replace("-","")

                for (int x = 0; x < List_Usuarios.Count; x++)
                {
                    DPFP.Template templeate = new DPFP.Template();
                    templeate.DeSerialize(List_Usuarios[x].dedo);

                    //Compare the feature set with our template
                    DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                    Verificator.Verify(features, templeate, ref result);
                    //UpdateStatus(result.FARAchieved);
                    if (result.Verified)
                    {
                        MessageBox.Show("VERIFICADO  " + List_Usuarios[x].nombre_usuario);//MakeReport("The fingerprint was VERIFIED.");
                        return;
                    }
                }

                MessageBox.Show("NO ENCONTRADO");

                //if (templeate == null)
                //    return;
            }
        }
        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);
            }
        }
Exemplo n.º 10
0
        protected virtual void Process(DPFP.Sample Sample)
        {
            DrawPicture(ConvertSampleToBitmap(Sample));
            DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);

            if (features != null)
            {
                byte[] bytes = new byte[1632];
                features.Serialize(ref bytes);

                imprimir imprimir = new imprimir(mostrar_info);

                for (int x = 0; x < lista.Count; x++)
                {
                    DPFP.Template templeate = new DPFP.Template();

                    //if (lista[x].huella == null)
                    //{
                    //    return;
                    //}

                    templeate.DeSerialize(lista[x].huella);

                    DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();

                    Verificator.Verify(features, templeate, ref result);

                    if (result.Verified)
                    {
                        id_usuario = lista[x].id_cliente;
                        tipo_persona = lista[x].tipo;

                        if (tipo_persona == "Cliente")
                        {
                            if (id_usuario == id_usuario_anterior && tipo_persona == tipo_persona_anterior)
                            {

                            }
                            else
                            {
                                var fecha = contexto.sp_Buscar_Clientes_Id(id_usuario).ToList();

                                //if()
                                valor = verificar_vencimiento(Convert.ToDateTime(fecha[0].fecha_corte));
                                //var usuario = (from cliente in contexto.Catalogo_Clientes where cliente.id_cliente == id_usuario select cliente).Single();

                                var data = (Byte[])fecha[0].foto;
                                var stream = new MemoryStream(data);
                                Foto_videoSourcePlayer.BackgroundImage = Image.FromStream(stream);

                                this.Invoke(imprimir, new Object_Checado() { nombre = fecha[0].nombre, valor = valor, fecha = Convert.ToDateTime(fecha[0].fecha_corte) });

                                id_usuario_anterior = id_usuario;
                                tipo_persona_anterior = tipo_persona;

                                timer1.Start();
                            }
                        }
                        else if (tipo_persona == "Instructor")
                        {
                            if (id_usuario == id_usuario_anterior && tipo_persona == tipo_persona_anterior)
                            {

                            }
                            else
                            {
                                var estatus = contexto.sp_Buscar_Instructor_Id(id_usuario).First();

                                if (estatus.estatus == true)
                                {
                                    contexto.sp_Registro_Ingreso(id_usuario, true, true, id_responsable);
                                }
                                else if (estatus.estatus == false)
                                {
                                    contexto.sp_Registro_Ingreso(id_usuario, true, false, id_responsable);
                                }

                                var usuario = (from cliente in contexto.Catalogo_Instructores where cliente.id_instructor == id_usuario select cliente).First();

                                var data = (Byte[])usuario.foto;
                                var stream = new MemoryStream(data);
                                Foto_videoSourcePlayer.BackgroundImage = Image.FromStream(stream);

                                valor = 2;

                                this.Invoke(imprimir, new Object_Checado() { nombre = usuario.nombre, valor = valor });

                                id_usuario_anterior = id_usuario;
                                tipo_persona_anterior = tipo_persona;

                                timer1.Start();
                            }
                        }
                        return;
                    }
                }

                this.Invoke(imprimir, new Object_Checado() { nombre = "Desconocido", valor = 0 });
                color_pictureBox.BackColor = Color.White;
                Foto_videoSourcePlayer.BackgroundImage = Properties.Resources.Desconocido;
            }
        }