1 year ago
#310645
Alamzaib Farooq
I am using JavaScript to acquire .png fingerprint image and verifying acquired fingerprint using .NET but it's not working
I am using JavaScript SDK to acquire fingerprints using URU 4500 device and 3.2 Digital Persona SDK. The image is .png and I am sending it to the server in base64.
On the server, the image is converted to bytes and it is given to FeatureExtraction.CreateFmdFromRaw()
to generate FMD further, I am comparing 2 FMDs using Compare()
method.
Javascript Code to acquire image:
localStorage.setItem("imageSrc", "");
var samples = JSON.parse(s.samples);
document.getElementById("fingerCounts").innerHTML = "Finger Counts = " +
enrollmentCount;
if (identify) {
$.ajax({
type: "POST",
url: '/Biometric/Compare',
data: { fingerData:Fingerprint.b64UrlTo64(samples[0]), studentId: 1 },
dataType: "json",
success: function (data) {
if (data === true)
alert('You are matched.');
else {
alert('You are not matched');
}
},
error: function () {
alert('Error');
}
});
}
Here is the C# code where I am comparing two fingers one from DB and the other from request:
public JsonResult Compare(string fingerData, int studentId)
{
byte[] bytes = Convert.FromBase64String(fingerData);
var storeData = _context.StudentBiometricData.SingleOrDefault(x=>x.StudentId == studentId);
DataResult<Fmd> currentFinger = FeatureExtraction.CreateFmdFromRaw(bytes, 1,
3407615, 500, 550, 700, Constants.Formats.Fmd.ANSI);
Fmd recorderFmd = Fmd.DeserializeXml(storeData.FingerFMD);
CompareResult compareResult = Comparison.Compare(currentFinger.Data, 0,
recorderFmd, 1);
return Json(false);
}
When I create FMD from the raw images using CreateFmdFromRaw
it mostly gives DP_Faluir
. Compare()
method returns INVAID_PARAMETER. Where I am doing something wrong? The provided sample WPF application is working fine it does not give any error and working perfectly fine. I think it's because I am using an image instead of FID?
asp.net
.net
fingerprint
biometrics
digital-persona-sdk
0 Answers
Your Answer