我想问一些关于如何改进用于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