0

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?

Alamzaib Farooq
  • 190
  • 2
  • 18
  • did you find any way to use javascript with SDK? – dmance Oct 06 '22 at 06:37
  • @dmance no. I then created a small WPF application. Compare function will not work on web. Use their sample code for WPF. It wasted my lot of time then I moved to WPF – Alamzaib Farooq Oct 06 '22 at 11:45
  • Do sad... I'm using java and javascript and I can not make it properly identify fingerprints :S – dmance Oct 06 '22 at 11:50
  • @dmance it is not good to attach fingerprint devices with the web app. You should create a small Java app and connect it to web API. They have a sample app for Java too if you have latest SDK. – Alamzaib Farooq Oct 06 '22 at 20:55
  • actually I've found the way to do it properly. I have an Angular 13 application working with the digital persona 4500 and getting proper identification from the java backend. Right now I'm figuring how I can persist that data in a sql database :S – dmance Oct 07 '22 at 05:27
  • Keeping data in database is easy all you have to do is convert FMD to XML and save them as strings. There is a function that will let you convert to XML. You can read their docs. – Alamzaib Farooq Oct 07 '22 at 10:07
  • JAva api does not have this funcionality, but I can convert to base64 the byte array of the FMD data – dmance Oct 10 '22 at 12:02

0 Answers0