Abraham Olatubosun

Abraham Olatubosun

  • NA
  • 471
  • 107.4k

How to verify Finger print template with the SQL Server

Nov 25 2017 2:26 AM

Hi,

I am developing an application for biometric patient demographic registration, I was able to save the captured finger scanned to MS SQL server, on trying to verify the image from the scanner with the saved image is giving error's "Exception from HRESULT: 0xFFFFFFF8"Exception from HRESULT: 0xFFFFFFF8"bellow is my code for enrollment and verification.
  1. MemoryStream ms;  
  2. protected void Process(DPFP.Sample Sample,Image img1)   //DPFP.Sample Sample  
  3. {  
  4.     try  
  5.     {  
  6.         DPFP.Template Template = new DPFP.Template();  
  7.   
  8.         DataTable result_ = AppData.GetRecord();  
  9.         if (result_.Rows.Count >=1)  
  10.         {  
  11.             foreach (DataRow dt in result_.Rows)  
  12.             {  
  13.                 byte[] _img = (byte[])dt["Thumb1"];  
  14.                  ms = new MemoryStream(_img);  
  15.   
  16.                  //DPFP.FeatureSet FeatureSetT = new DPFP.FeatureSet();  
  17.                 DPFP.FeatureSet FeatureSetT = Extract_Feature(Sample, DPFP.Processing.DataPurpose.Verification); //  
  18.                 DPFP.Verification.Verification Verificator = new DPFP.Verification.Verification();  
  19.                 DPFP.Verification.Verification.Result Results = new DPFP.Verification.Verification.Result();  
  20.                 Template.DeSerialize(ms);  
  21.   
  22.   
  23.                 Verificator.Verify(FeatureSetT, Template, ref Results);  
  24.   
  25.                 if (Results.Verified)  
  26.                 {  
  27.                     // ver = true;  
  28.                     break;  
  29.                 }  
  30.                 else  
  31.                 {  
  32.                     DialogResult Result;  
  33.                     Result = MessageBox.Show("Finger Template not found in DB, Kindly fill the form.""Can't find image", MessageBoxButtons.OK);  
  34.                     if (Result == System.Windows.Forms.DialogResult.OK)  
  35.   
  36.                     ms = new MemoryStream(AppData.ImageToByte(img1));  
  37.                     Template.Serialize(ms);  
  38.                     ms.Position = 0;  
  39.                     BinaryReader br = new BinaryReader(ms);  
  40.                     Byte[] bytes_ = br.ReadBytes((Int32)ms.Length);  
  41.                    // AppData.SaveData(textBox1.Text, textBox2.Text, textBox3.Text, comboBox1.SelectedText, Convert.ToDateTime(dateTimePicker1.Text), bytes_);  
  42.                 }  
  43.   
  44.             }  
  45.         }  
  46.         else  
  47.         {  
  48.   
  49.             //AppData._Sex = comboBox1.SelectedItem.ToString();  
  50.             //AppData._DOB = Convert.ToDateTime(dateTimePicker1.Text);  
  51.             int Dis = 0;  
  52.             DialogResult Result;  
  53.             Result = MessageBox.Show("Finger Template not found in DB, Kindly fill the form.""Can't find image", MessageBoxButtons.OK);  
  54.             if (Result == System.Windows.Forms.DialogResult.OK)  
  55.   
  56.                 ms = new MemoryStream(AppData.ImageToByte(img1));  
  57.             //Template.Serialize(ms);  
  58.             ms.Position = 0;  
  59.             BinaryReader br = new BinaryReader(ms);  
  60.             Byte[] bytes_ = br.ReadBytes((Int32)ms.Length);  
  61.            Dis = AppData.SaveData(textBox1.Text, textBox2.Text, textBox3.Text,  bytes_);  
  62.             if(Dis == 1)  
  63.             {  
  64.                 MessageBox.Show("Data Saved successfully""Successful", MessageBoxButtons.OK);  
  65.             }  
  66.             else  
  67.             {  
  68.                 MessageBox.Show("Kindly complete each field before enrollment""Not Saved", MessageBoxButtons.OK);  
  69.             }  
  70.         }  
  71.           
  72.     }  
  73.     catch (Exception ex)  
  74.     {  
  75.   
  76.     }  
  77. }  
  78.   
  79.   
  80.   
  81. private DPFP.FeatureSet Extract_Feature(DPFP.Sample Sample, DPFP.Processing.DataPurpose Purpose)  
  82. {  
  83.      
  84.         var Extractor = new DPFP.Processing.FeatureExtraction();  
  85.         DPFP.Capture.CaptureFeedback FeedBack = DPFP.Capture.CaptureFeedback.None;  
  86.         var Features = new DPFP.FeatureSet();  
  87.       
  88.         Extractor.CreateFeatureSet(Sample,Purpose,ref FeedBack,ref Features);  
  89.         if(FeedBack == DPFP.Capture.CaptureFeedback.Good)  
  90.            return Features;  
  91.         else  
  92.         return null;  
  93. }  

kindly show me module to save the image templete to MS SQL server and which data type siutable for the Templete and module for verification.

Thank you

 

Answers (1)