数字角色指纹验证需要花费大量时间 [英] Digital persona fingerprint verification takes a lot of time
本文介绍了数字角色指纹验证需要花费大量时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Digital Persona U.are.U 4000b指纹识别器,我有这个功能验证来自SQL服务器的指纹
我的问题是循环,因为它花费大量时间来比较模板。
请给我一些关于如何优化或修改我的代码的建议。
什么我试过了:
受保护的子流程(ByVal样本为DPFP.Sample)
con =新的SqlConnection
con.ConnectionString =Data Source = paulv; Initial Catalog = TestDB; Persist Security Info = True; User ID = sa; Password = Passw0rd
Dim command As String = SELECT * FROM Bio_Emplist
Dim da As New SqlDataAdapter(command,con)
Dim dtb As New DataTable
da.Fill(dtb)
if dtb。 Rows.Count> 0然后
rowCount = dtb.Rows.Count
尝试
For each dr As DataRow in dtb.Rows
Dim fpt As Byte()= CType(dr(Fpt)) ,Byte())
Dim ms As New MemoryStream(fpt)
Dim tmpObj As DPFP.Template = New DPFP.Template
Dim verify As DPFP.Verification.Verification = New DPFP.Verification.Verification
Template = tmpObj
tmpObj.DeSerialize(fpt)
DrawPicture(ConvertSampleToBitmap(Sample))
Dim功能作为DPFP.FeatureSet = ExtractFeatures(Sample,DPFP.Processing.DataPurpose.Verification)
'检查样本的质量并开始验证,如果它是好的
如果不是功能什么都没有那么
'比较使用我们的模板设置的功能
Dim result As DPFP.Verification.Verification.Result = New DPF P.Verification.Verification.Result()
verify.Verify(features,Template,result)
'UpdateStatus(result.FARAchieved)
如果result.Verified那么
MakeReport(指纹已经过验证。)
empID = dr(EmpID)
empFName = dr(FName)
empLName = dr(LName) )
SetVerifyText(empID,empFName,empLName)
退出试试
否则
FailedVerifyText()
如果rowCount = 1则
MakeReport(指纹是未经验证。)
否则
rowCount = rowCount - 1
MakeReport(查找匹配...)
结束如果
结束如果
结束如果
下一个
Catch ex As Exception
MsgBox(ex.ToString)
结束尝试
结束如果
结束子
解决方案
创建一个获取Fmds的函数。
私人fingerList作为新列表(Fmd)
检查:
https:// www。 codeproject.com/Questions/1250431/How-can-I-save-and-retrieve-a-fingerprint-template
I'm using Digital Persona U.are.U 4000b fingerprint reader and I have this function that verifies the fingerprint from SQL server My problem is the loop because it takes a lot of time to compare the templates. Please give me some advice on how can I optimize or revise my code.
What I have tried:
Protected Sub Process(ByVal Sample As DPFP.Sample) con = New SqlConnection con.ConnectionString = "Data Source=paulv;Initial Catalog=TestDB;Persist Security Info=True;User ID=sa;Password=Passw0rd" Dim command As String = "SELECT * FROM Bio_Emplist" Dim da As New SqlDataAdapter(command, con) Dim dtb As New DataTable da.Fill(dtb) If dtb.Rows.Count > 0 Then rowCount = dtb.Rows.Count Try For Each dr As DataRow In dtb.Rows Dim fpt As Byte() = CType(dr("Fpt"), Byte()) Dim ms As New MemoryStream(fpt) Dim tmpObj As DPFP.Template = New DPFP.Template Dim verify As DPFP.Verification.Verification = New DPFP.Verification.Verification Template = tmpObj tmpObj.DeSerialize(fpt) DrawPicture(ConvertSampleToBitmap(Sample)) Dim features As DPFP.FeatureSet = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification) ' Check quality of the sample and start verification if it's good If Not features Is Nothing Then ' Compare the feature set with our template Dim result As DPFP.Verification.Verification.Result = New DPFP.Verification.Verification.Result() verify.Verify(features, Template, result) 'UpdateStatus(result.FARAchieved) If result.Verified Then MakeReport("The fingerprint was VERIFIED.") empID = dr("EmpID") empFName = dr("FName") empLName = dr("LName") SetVerifyText(empID, empFName, empLName) Exit Try Else FailedVerifyText() If rowCount = 1 Then MakeReport("The fingerprint was NOT VERIFIED.") Else rowCount = rowCount - 1 MakeReport("Finding Match...") End If End If End If Next Catch ex As Exception MsgBox(ex.ToString) End Try End If End Sub
解决方案
Create a Function for getting the Fmds.
Private fingerList As New List(Of Fmd)
Check This :
https://www.codeproject.com/Questions/1250431/How-can-I-save-and-retrieve-a-fingerprint-template
这篇关于数字角色指纹验证需要花费大量时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文