我正在尝试使用Digital Persona SDK验证指纹。我可以使用以下代码捕获并将模板保存到MySQL数据库,但是问题出在验证期间。当我尝试验证指纹时,总是显示失败。这是注册和验证代码。我会发布注册代码,但是由于冗长的代码,stackoverflow无法让我
protected void process(DPFPSample sample) {
super.process(sample);
// Process the sample and create a feature set for the enrollment purpose.
features = extractFeatures(sample, DPFPDataPurpose.DATA_PURPOSE_VERIFICATION);
// Check quality of the sample and start verification if it's good
if (features != null) {
// Compare the feature set with our template
DPFPVerificationResult result = verificator.verify(features, ((MainForm) getOwner()).getTemplate());
// updateStatus(result.getFalseAcceptRate());
if (result.isVerified()) {
try {
DPFPTemplate templat = ((MainForm) getOwner()).getTemplate();
byte[] vrr = templat.serialize();
pst = con.prepareStatement("select fingerprint from accounts where fingerprint=?");
pst.setBytes(1, vrr);
rs = pst.executeQuery();
if (rs.next()) {
JOptionPane.showMessageDialog(this, "Fingerprint doesn't match the User ID", "Unable to Login", JOptionPane.ERROR_MESSAGE);
} else {
JOptionPane.showMessageDialog(this, "Fingerprint doesn't match the User ID", "Unable to Login", JOptionPane.ERROR_MESSAGE);
}
} catch (SQLException e) {
}
} else {
makeReport("The fingerprint was NOT VERIFIED.");
JOptionPane.showMessageDialog(this, "The fingerprint was NOT VERIFIED.", "Verification Failed", JOptionPane.ERROR_MESSAGE);
}
}
}
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。