我基本上需要使用生物识别技术从用户那里获取信息,为此,我正在使用数字人的生物识别读取器(U.are.U 4500)。 问题是,有时我碰巧是来自另一个用户的信息,以防我将手指放在读取器上被读取,而不是返回我的数据,而是从另一个用户返回了信息。 我注意到一件事,我正在以字节格式([byte])保存生物特征。当我要注册生物识别信息时,我的字节数组通常包含1000个项目。当我进行比较时,通常从数据库返回字节,但是我将用于与数据库进行比较的字节数组是300。这听起来像胡说八道,但是有什么干扰吗?无论如何,我将提供源!谢谢您的帮助。
关于我注意到的字节的小细节:
寄存器中的字节:
检查字节:
我试图在此处发布图像,但被堆栈溢出阻止了:)
注册生物特征识别
:memoryTemplate = new MemoryStream();
Template.Serialize(memoryTemplate);
memoryTemplate.Position = 0;
brReader = new BinaryReader(memoryTemplate);
serializedTemplate = brReader.ReadBytes((Int32)memoryTemplate.Length);
DALUsuario usuario = new DALUsuario();
//I execute the method to register biometrics
usuario.CadastrarBiometria(Apoio.stCodUsuario, Finger, serializedTemplate);
// usuario.CadastrarBiometria:
con = new SqlConnection();
apoio = new Apoio();
con = apoio.conexaoBD(con);
command = new StringBuilder();
fkMao = VerificarMao(fkDedo);
command.Append("INSERT INTO TBL_BIOMETRIA (FK_USUARIO, FK_DEDO, FK_MAO, BIOMETRIA) ");
command.Append("VALUES (@idUser, @fkDedo, @fkMao, @Biometria)");
cmd = new SqlCommand(command.ToString(), con);
cmd.Parameters.AddWithValue("@IdUser", idUsuario);
cmd.Parameters.AddWithValue("@fkDedo", fkDedo);
cmd.Parameters.AddWithValue("@fkMao", fkMao);
cmd.Parameters.AddWithValue("@Biometria", Template);
cmd.ExecuteNonQuery();
//生物特征检查
private void VerificationControl1_OnComplete(object Control, DPFP.FeatureSet FeatureSet, ref DPFP.Gui.EventHandlerStatus EventHandlerStatus) {
DPFP.Verification.Verification ver = new DPFP.Verification.Verification();
DPFP.Verification.Verification.Result res = new DPFP.Verification.Verification.Result();
Usuario user = null;
DALUsuario dalUser = null;
// Compare feature set with all stored templates.
user = new Usuario();
dalUser = new DALUsuario();
// I execute the method that takes the user's biometry and compares it with the one of the database
user = dalUser.RetornaBiometria(FeatureSet);
}
// dalUser.RetornaBiometria:
while (reader.Read()) {
user.iCodUsuario = Convert.ToInt32(reader["FK_USUARIO"]);
user.Biometria = (byte[]) reader["BIOMETRIA"];
memoryStream = new MemoryStream(user.Biometria);
DPFP.Template tmpObj = new DPFP.Template();
tmpObj.DeSerialize(memoryStream);
DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
// I MAKE COMPARISON OF THE USER'S BIOMETRY WITH THE BIOMETRIES REGISTERED IN THE DATABASE
ver.Verify(FeatureSet, tmpObj, ref res);
Data.IsFeatureSetMatched = res.Verified;
Data.FalseAcceptRate = res.FARAchieved;
if (res.Verified) {
break; // success
}
fpTemp = null;
}