我想問一些關於如何改進用於Digital Persona SDK驗證的C#代碼的建議。我注意到,當我在數據庫中達到了blob的3000條記錄時,將它們放在DPFP.Template []模板數組中。它運行速度很慢。Digital Persona SDK驗證速度很慢?
有沒有更好的方法來做到這一點?
這裏是我的代碼:
foreach (DPFP.Template template in templateArr)
{
count--;
String my_id = empids[count].ToString();
// Get template from storage.
// Compare feature set with particular template.
ver.Verify(features, template, ref res); // This code loops for all 3000 records and causes the verification to slow down.
if (res.Verified)
{
SetPrompt("You Have ");
MakeReport("LOGGED IN!");
getEmployeeData(my_id);
getStatus(my_id);
break; // success
}
}
if (!res.Verified)
{
SetPrompt("Please ");
MakeReport("TRY AGAIN!");
}
這裏是我的代碼捕獲,並把所有的BLOB保存的模板從數據庫中: 公共DPFP.Template [] templateArray(){
//String strSQL = "SELECT emp_id, fpt_template FROM tbl_employees WHERE fpt_template != ''";
String strSQL = "SELECT emp_id, finger_template FROM tbl_fingers WHERE finger_template != ''";
DataTable dt;
DPFP.Template myTemplate;
dt = this.QueryDataTable(strSQL);
object objByte;
byte[] bytData;
//*** Bind Rows ***//
if (dt.Rows.Count > 0)
{
DPFP.Template[] arrTemplate = new DPFP.Template[dt.Rows.Count];
Int32 counter = dt.Rows.Count;
foreach (DataRow dr in dt.Rows)
{
//Object fpt_template = dr["fpt_template"];
Object fpt_template = dr["finger_template"];
objByte = (byte[])(fpt_template);
bytData = (byte[])objByte;
// Convert Blob data to object and then byte
System.IO.MemoryStream ms = new System.IO.MemoryStream(bytData);
myTemplate = new DPFP.Template(ms);
arrTemplate[counter - 1] = myTemplate;
counter--;
}
return arrTemplate;
}
this.Close();
return null;
}
順便說一下,我使用C#與MySQL 先謝謝您!
我接受任何想法只是爲了提高驗證性能。我卡在這裏,真的很感謝一些幫助。 :) – user1582143 2012-08-08 09:27:22
嘿傢伙。你解決了你的問題嗎?我也遇到了同樣的麻煩。我有一個3000模板數據庫,識別過程需要很長時間。我正在使用相同的技術(存儲,循環和逐個驗證)。你解決了嗎?謝謝 – 2013-02-27 18:42:04