我正在使用 Digital Persona 5300 指纹读取器,并且我有一个 SQL 数据库,其中以 varbinary 格式捕获指纹,我想知道是否有办法获取指纹并生成 FMD 以将读取器中捕获的指纹与数据库知道它属于谁。这是我尝试过但无法正常工作的代码的一部分
try{
Engine engine = UareUGlobal.GetEngine();
Fmd fmd = engine.CreateFmd(evt.capture_result.image, Fmd.Format.ANSI_378_2004);
m_fmds[0] = fmd; //Save the fingerprint capture
}
catch(UareUException e){ MessageBox.DpError("Engine.CreateFmd()", e); }
if(null != m_fmds[0] ){
//perform comparison
try{
Connection connection;
connection = con.conectar();
//Get all fingerprints
PreparedStatement identificarStmt = null;
try {
identificarStmt = connection.prepareStatement("SELECT no_empleado,id_relojChecador FROM relojChecador_empleado");
ResultSet rs = null;
rs = identificarStmt.executeQuery();
//Find the fingerprint
while(rs.next())
{
//Lee la plantilla de la base de datos
byte templateBuffer[] = rs.getBytes("id_relojChecador");
String nombre=rs.getString("no_empleado");
Fmd fmd = engine.CreateFmd(templateBuffer, templateBuffer.length, WIDTH, WIDTH, WIDTH, WIDTH, Fmd.Format.DP_REG_FEATURES);
int falsematch_rate = engine.Compare(m_fmds[0], 0, m_fmds[1], 0);
int target_falsematch_rate = Engine.PROBABILITY_ONE / 100000; //target rate is 0.00001
if(falsematch_rate < target_falsematch_rate){
m_text.append("Fingerprints matched.\n");
String str = String.format("dissimilarity score: 0x%x.\n", falsematch_rate);
m_text.append(str);
str = String.format("false match rate: %e.\n\n\n", (double)(falsematch_rate / Engine.PROBABILITY_ONE));
m_text.append(str);
}
else{
m_text.append("Fingerprints did not match.\n\n\n");
}
}
catch(UareUException e){ MessageBox.DpError("Engine.CreateFmd()", e); }
} } catch (SQLException ex) {
Logger.getLogger(Verification.class.getName()).log(Level.SEVERE, null, ex);
}
//discard FMDs
m_fmds[0] = null;
m_fmds[1] = null;
}