0

I am using mantra fingerprint scanner to get finger print data, I want to store the fingerprint data in mysql.Later i want to compare with other. I am facing issue in Storing the data in mysql.

here is the code where after scanner gives the fingerprint data.

private void StartSyncCapture() {

    runOnUiThread(new Thread(new Runnable() {

        @Override
        public void run() {
            try {
                FingerData fingerData = new FingerData();
                int ret = mfs100.AutoCapture(fingerData, timeout, false,
                        true);
                if (ret != 0) {
                    Toast.makeText(getApplicationContext(), "StartSyncCapture " + mfs100.GetErrorMsg(ret), Toast.LENGTH_SHORT).show();
                } else {

                    if (fingerData.Quality() >= minQuality) {

                        final Bitmap bitmap = BitmapFactory.decodeByteArray(
                                fingerData.FingerImage(), 0,
                                fingerData.FingerImage().length);
                        imgFinger.post(new Runnable() {
                            @Override
                            public void run() {
                                imgFinger.setImageBitmap(bitmap);
                                imgFinger.refreshDrawableState();
                            }
                        });

                        Toast.makeText(getApplicationContext(), "Capture Success", Toast.LENGTH_SHORT).show();
                        String log = "\nQuality: " + fingerData.Quality()
                                + "\nNFIQ: " + fingerData.Nfiq()
                                + "\nWSQ Compress Ratio: "
                                + fingerData.WSQCompressRatio()
                                + "\nImage Dimensions (inch): "
                                + fingerData.InWidth() + "\" X "
                                + fingerData.InHeight() + "\""
                                + "\nImage Area (inch): " + fingerData.InArea()
                                + "\"" + "\nResolution (dpi/ppi): "
                                + fingerData.Resolution() + "\nGray Scale: "
                                + fingerData.GrayScale() + "\nBits Per Pixal: "
                                + fingerData.Bpp() + "\nWSQ Info: "
                                + fingerData.WSQInfo();

                        Toast.makeText(getApplicationContext(), "fingerData.Quality()" + fingerData.Quality() + "StartSyncCapture is " + fingerData.ISOTemplate().length, Toast.LENGTH_SHORT).show();
                        mFingerData = fingerData;

                        //////////////////// Extract ISO Image
                        int dataLen = 0;
                        byte[] tempData = new byte[(mfs100.GetDeviceInfo().Width() * mfs100.GetDeviceInfo().Height()) + 1078];
                        byte[] isoImage = null;
                        dataLen = mfs100.ExtractISOImage(fingerData.RawData(), tempData);
                        if (dataLen <= 0) {
                            if (dataLen == 0) {
                                Toast.makeText(getApplicationContext(), "Failed to extract ISO Image", Toast.LENGTH_SHORT).show();
                            } else {
                                Toast.makeText(getApplicationContext(), mfs100.GetErrorMsg(dataLen), Toast.LENGTH_SHORT).show();
                            }
                            return;
                        } else {
                            isoImage = new byte[dataLen];
                            System.arraycopy(tempData, 0, isoImage, 0, dataLen);

                            mISOImage = new byte[dataLen];
                            System.arraycopy(tempData, 0, mISOImage, 0, dataLen);


                        }

                    } else {
                        Toast.makeText(getApplicationContext(), "Please try again", Toast.LENGTH_SHORT).show();
                    }

                }

            } catch (Exception ex) {
                Toast.makeText(getApplicationContext(), "Error", Toast.LENGTH_SHORT).show();
            }
        }
    }));
}
user7271205
  • 21
  • 1
  • 2

3 Answers3

0

fingerprint scanners only return image, either you can store bitmap into database or you can save image into local storage and path of image into database.

you can use external library to convert image to minutiae and enroll and verify as:

http://www.nist.gov/itl/iad/ig/nbis.cfm

http://www.neurotechnology.com/verifinger.html

0

Images having of different types such as bitmap, iso, wsq etc.. normally, from photo viewer only bitmap image can be previewed. But if you want to preview iso image (19794-4) then you need iso viewer and if you want to preview wsq image then you need to use wsq viewer.

About storing images in to database, you need to use blob datatype and you need to convert bitmap image into byte array and then you have to store into database.

but remember, if you want to use stored image for verification purpose then you need to store ISO Template (19794-2) into your database.

to get ISO template (19794-2), you have to use mfs100.ExtractISOTemplate function of SDK.

0

also best solution for store and reuse your fingerprint data in Mantra device so save your ISO temple to base64 string and store base64 string in database and get fingerprint data from database so create file from base64 to ISO temple

check this url Base 64 encode and decode example code

milan pithadia
  • 840
  • 11
  • 16