protected override void Process(DPFP.Sample Sample) { base.Process(Sample); DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Enrollment); if (features != null) { try { Enroller.AddFeatures(features); } finally { switch (Enroller.TemplateStatus) { case DPFP.Processing.Enrollment.Status.Ready: OnTemplate(Enroller.Template); Stop(); break; case DPFP.Processing.Enrollment.Status.Failed: Enroller.Clear(); Stop(); OnTemplate(null); Start(); break; } } } }
private void verifyControl_OnComplete(object Control, DPFP.FeatureSet featureSet, ref DPFP.Gui.EventHandlerStatus EventHandlerStatus) { if (!chkTimeInAM.Checked && !chkTimeOutAM.Checked && !chkTimeInPM.Checked && !chkTimeOutPM.Checked && !chkTimeOutEvening.Checked && !chkTimeInEvening.Checked) { lblTimeLog.Text = "Toggle event first."; return; } var ver = new Verification(); var res = new Verification.Result(); //ClearProfile(); var stat = 0; // Compare feature set with all stored templates. foreach (var ft in fingerTemplateList.Where(ft => ft.FPTemplateFile != null)) { // Compare feature set with particular template. ver.Verify(featureSet, ft.FPTemplateFile, ref res); if (!res.Verified) { continue; } GetProfile(ft.EmpID); stat = 1; break; // success } ShowNotFound(stat); }
protected override void Process(Sample Sample) { base.Process(Sample); DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Enrollment); if (features != null) { try { MakeReport("The fingerprint featureset was created"); Enroller.AddFeatures(features); } finally { UpdateStatus(); 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"); Stop(); break; case DPFP.Processing.Enrollment.Status.Failed: Enroller.Clear(); Stop(); UpdateStatus(); OnTemplate(null); Start(); break; } } } }
protected override void Process(DPFP.Sample Sample) { base.Process(Sample); DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification); if (features != null) { DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result(); DPFP.Template template = new DPFP.Template(); Stream stream; //foreach (var item in context.Students) //{ // stream = new MemoryStream(item.Pattern); // template = new DPFP.Template(stream); // Verificator.Verify(features, template, ref result); // UpdateStatus(result.FARAchieved); // if(result.Verified) // { // MakeReport("FingerPrint was verified" + item.Name); // MessageBox.Show("User " + item.Name + " found."); // break; // } //} } }
protected void Compare(Template template, Sample sample) { try { // Process the sample and create a feature set for the enrollment purpose. //MemoryStream ms = new MemoryStream(Funciones.ImageToByteArray(this.picHuella.Image)); //DPFP.Sample sample = new DPFP.Sample(ms); 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) { MessageBox.Show(this, "El usuario coincide con el existente!", "Validador Huella", MessageBoxButtons.OK, MessageBoxIcon.Information); MakeReport("El usuario coincide con el existente!"); } else { MessageBox.Show(this, "El usuario No coincide con el existente!", "Validador Huella", MessageBoxButtons.OK, MessageBoxIcon.Information); MakeReport("El usuario No coincide con el existente!."); } } } catch (Exception ex) { MakeReport(ex.Message); } }
public void OnComplete(object Capture, string ReaderSerialNumber, DPFP.Sample Sample) { MakeReport("fingerprint captured."); SetPrompt("Scan fingerprint again"); //Process(Sample); try { Connection con = new Connection(); con.Connect(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select RESIDENT_FINGERPRINT, RESIDENT.RESIDENT_ID,PROGRAM.PROGRAM_ID,LIST.RESIDENT_ID,LIST.PROGRAM_ID FROM RESIDENT LEFT JOIN LIST ON RESIDENT.RESIDENT_ID = LIST.RESIDENT_ID LEFT JOIN PROGRAM ON PROGRAM.PROGRAM_ID = RESIDENT.RESIDENT_ID WHERE LIST.PROGRAM_ID ='" + label2.Text + "' AND LIST_VERIFICATION IS NULL"; cmd.Connection = Connection.con; SqlDataAdapter sd = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); sd.Fill(dt); foreach (DataRow dr in dt.Rows) { byte[] _img = (byte[])dr["resident_fingerprint"]; string id = dr["RESIDENT_ID"].ToString(); string pid = dr["PROGRAM_ID"].ToString(); MemoryStream ms = new MemoryStream(_img); DPFP.Template Template = new DPFP.Template(); Template.DeSerialize(ms); DPFP.Verification.Verification Verificator = new DPFP.Verification.Verification(); Process(Sample); DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification); if (features != null) { DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result(); Verificator.Verify(features, Template, ref result); UpdateStatus(result.FARAchieved); if (result.Verified) { MessageBox.Show("Verified!!!"); SqlCommand cmds = new SqlCommand(); cmds.CommandText = "UPDATE LIST SET LIST_VERIFICATION ='True' WHERE LIST.RESIDENT_ID = '" + id.ToString() + "' AND LIST.PROGRAM_ID = '" + label2.Text + "'"; cmds.Connection = Connection.con; SqlDataReader dar = cmds.ExecuteReader(); } else { MakeReport("Not registered as a resident!"); } } else { } } } catch { } }
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; } }
public void OnComplete(object Capture, string ReaderSerialNumber, Sample Sample) { SetImagePawprint(Sample); DPFP.FeatureSet featureSet = CreateFeatureSet(Sample, DPFP.Processing.DataPurpose.Verification); if (featureSet != null) { DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result(); List <User> ListUser = mySqlAdapter.GetAllUsers(); foreach (User user in ListUser) { MemoryStream ms = new MemoryStream(user.Pawprint); template.DeSerialize(ms.ToArray()); verification.Verify(featureSet, template, ref result); if (result.Verified) { display("Hola: " + user.Name); break; } else { display("No match found"); } } } else { MessageBox.Show("Nothing found here"); } }
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 void btnThumbCheckIn_Click(object sender, EventArgs e) { log4net.ILog logger = log4net.LogManager.GetLogger("File"); bool success = false; //try //{ Template template1 = new Template(); FeatureSet featureSet = new FeatureSet(); SqlParameter[] para = new SqlParameter[1]; if (ddllocation.Text.Trim() != "") { //para[0] = new SqlParameter("@Role", Session["user_role"].ToString()); para[0] = new SqlParameter("Staff_ID", Session["StaffID"].ToString()); DataTable dt = dal.executeprocedure("usp_GetRoleThumbPrints", para, false); foreach (DataRow dr in dt.Rows) { template1 = new DPFP.Template(); template1.DeSerialize((byte[])dr["ThumbImage"]); featureSet = new DPFP.FeatureSet(); featureSet.DeSerialize(HexsToArray(hdnFP.Value)); if (VerifyFingerprints(template1, featureSet)) { string ipaddress = Request.ServerVariables["REMOTE_ADDR"].ToString(); string staffid = dt.Rows[0]["Staff_ID"].ToString(); getLocationIDByName(ddllocation.Text.Trim()); int locid = Convert.ToInt32(SearchLocID.Text); SqlParameter[] para1 = new SqlParameter[5]; para1[0] = new SqlParameter("@UserID", staffid); para1[1] = new SqlParameter("@IPAddress", ipaddress); para1[2] = new SqlParameter("@Location_ID", locid); para1[3] = new SqlParameter("@Logintime", DateTime.Now); para1[4] = new SqlParameter("@Fromdate", DateTime.Now); dal.executeprocedure("SP_AddThumbStoreInfo", para1); Response.Redirect("~/ADMIN/ThumbAfter.aspx"); } success = true; } } else { lblerror.Visible = true; lblerror.Text = "Please Select The Location"; } if (!success) { if (!(lblerror.Text.ToLower().Contains("already"))) { lblerror.Text = "Invalid Thumbprint. Please Put Correct Finger."; lblerror.Visible = true; } } }
void DPFP.Capture.EventHandler.OnComplete(object capture, string readerSerialNumber, Sample sample) { DelegadoEstado delegado = new DelegadoEstado(this.Estado); DPFP.Capture.SampleConversion convertor = new DPFP.Capture.SampleConversion(); Bitmap bitmap = null; convertor.ConvertToPicture(sample, ref bitmap); DPFP.Processing.FeatureExtraction Extractor = new DPFP.Processing.FeatureExtraction(); DPFP.Capture.CaptureFeedback feedback = DPFP.Capture.CaptureFeedback.None; DPFP.FeatureSet feature = new DPFP.FeatureSet(); Extractor.CreateFeatureSet(sample, DPFP.Processing.DataPurpose.Enrollment, ref feedback, ref feature); if (feedback == DPFP.Capture.CaptureFeedback.Good) { enroller.AddFeatures(feature); switch (enroller.TemplateStatus) { case DPFP.Processing.Enrollment.Status.Failed: { this.Dispatcher.Invoke(delegado, "La captura de la huella no fue correcta.\nPor favor reintente", "error", bitmap); break; } case DPFP.Processing.Enrollment.Status.Insufficient: { this.Dispatcher.Invoke(delegado, "La captura de la huella fue correcta.\nPor favor repita la lectura", "acierto", bitmap); break; } case DPFP.Processing.Enrollment.Status.Ready: { this.Dispatcher.Invoke(delegado, "La captura de la huella fue correcta.\nPor favor grabe la lectura realizada", "valido", bitmap); break; } default: { this.Dispatcher.Invoke(delegado, "La captura de la huella no fue correcta.\nPor favor reintente", "error", bitmap); break; } } } else { this.Dispatcher.Invoke(delegado, "La captura de la huella no fue correcta.\n Por favor reintente", bitmap); } }
protected void Process(DPFP.Sample Sample) { contador desplegar = new contador(Change_Label); // Draw fingerprint sample image. DrawPicture(ConvertSampleToBitmap(Sample)); //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."); try { Enroller.AddFeatures(features); // Add feature set to template. //intentos_label.Text = Convert.ToString(intentos - 1); this.Invoke(desplegar); } catch { MessageBox.Show("Error al capturar, vuelva a intentar", "Information", MessageBoxButtons.OK, MessageBoxIcon.Warning); intentos = 4; mensaje_label.Text = Convert.ToString(intentos); } } 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); //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; } } } }
public DPFP.FeatureSet CreateFeatureSet(DPFP.Sample sample, DPFP.Processing.DataPurpose purpose) { DPFP.Processing.FeatureExtraction featureExtraction = new DPFP.Processing.FeatureExtraction(); DPFP.Capture.CaptureFeedback captureFeedback = DPFP.Capture.CaptureFeedback.None; DPFP.FeatureSet featureSet = new DPFP.FeatureSet(); featureExtraction.CreateFeatureSet(sample, purpose, ref captureFeedback, ref featureSet); return((captureFeedback == DPFP.Capture.CaptureFeedback.Good) ? featureSet : null); }
protected override void Process(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 for (int i = 0; i < Templates.Count; i++) { var template = Templates[i]; Verificator.Verify(features, template, ref result); if (result.Verified) { found = true; MakeReport("VERIFIED SUCCESSFULLY."); Staff = Fingerprints[i].Staff; this.Invoke(new Function(delegate() { this.StaffVerified?.Invoke(this, new EventArgs()); })); Start(); break; } index++; } if (!found) { MakeReport("VERIFY FAILED."); Start(); } } } catch (Exception ex) { MessageBox.Show("An error occured while comparing with fingerprint database. \n\r\n\r" + ex.ToString()); } }
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); }
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()); } }
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); } }
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 */); } }
private bool VerifyFingerprints(DPFP.Template TemplateLeftIndex, DPFP.FeatureSet FeatureSet) { Verification.Result Result = new Verification.Result(); Verification Verification = new Verification(); // Verify the left index finger. Verification.Verify(FeatureSet, TemplateLeftIndex, ref Result); if (Result.Verified) { return(true); } // No match occurred. return(false); }
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); } }
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); } }
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); } }
public bool NonUnique(ref Bitmap LeftFinger, ref Bitmap RightFinger) { try { // convert the leftfinger to sample Sample LeftSample = ConvertRawBmpAsSample(LeftFinger); // convert the right finger as template Template RightTemplate = ConvertRawBmpAsTemplate(RightFinger, DataPurpose.Verification); // Process the sample and create a feature set for the enrollment purpose. DPFP.FeatureSet features = ExtractFeatures(LeftSample, DPFP.Processing.DataPurpose.Verification); Stopwatch sw = new Stopwatch(); // Check quality of the sample and start verification if it's good if (features != null & RightTemplate != null) { // loads the collection DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result(); // timer for current comparison sw.Start(); result = DPFP.Verification.Verification.Verify(features, RightTemplate, 0x7FFFFFFF / 100000); if (result.Verified) { return(true); } else { return(false); } sw.Stop(); } else { throw new Exception("Fingerprint is of low quality"); } } catch (Exception ex) { throw ex; } return(false); }
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(); } }
/// <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; } } } }
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 */); } }
public void OnComplete(object Capture, string ReaderSerialNumber, Sample Sample) { DPFP.Verification.Verification Ver = new DPFP.Verification.Verification(); DPFP.Verification.Verification.Result Res = new DPFP.Verification.Verification.Result(); DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification); foreach (AppData Te in Temp) { if (Te != null) { Ver.Verify(features, Te.Template, ref Res); if (Res.Verified) { MessageBox.Show(String.Format("Se encontro la huella en el usuario {0}", Te.IDCliente)); break; // se encontro } } } }
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; } } }
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; } } } }
private string[] VerifyDB(DPFP.FeatureSet features) { string[] arr = new string[5]; OdbcConnection cn; OdbcCommand cmd; byte[] temp = new byte[0]; string query = "Select * from fpbasic"; string dsnname = "fpbasic"; string uid = "Administrator"; string password = "******"; cn = new OdbcConnection("dsn=" + dsnname + "; UID=" + uid + "; PWD=" + password + ";"); cn.Open(); cmd = new OdbcCommand(query, cn); OdbcDataReader reader = cmd.ExecuteReader(); DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result(); Verifier = new DPFP.Verification.Verification(); while (reader.Read()) { for (int index = 0; index < reader.FieldCount; index++) { Stream stream = new MemoryStream((byte[])reader.GetValue(5)); DPFP.Template obj = new DPFP.Template(stream); Verifier.Verify(features, obj, ref result); if (result.Verified) { arr[0] = "true"; arr[1] = reader.GetString(1); arr[2] = reader.GetString(2); arr[3] = reader.GetString(3); arr[4] = reader.GetInt32(4).ToString(); return(arr); } } } cn.Close(); arr[0] = "false"; return(arr); }
protected 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; }