0 Replies - 413 Views - Last Post: 22 June 2017 - 05:00 AM

#1 vinod_jadhav  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 22-June 17

How to match finger data using SecuGen SDK?

Posted 22 June 2017 - 05:00 AM

I am using SecuGen sdk for scan fingerprint. I am using given sample application.
Following is the code for capture finger print.

public void CaptureFingerPrint() {
        this.mTextViewResult.setText("Capturing FingerPrint");
        this.runOnUiThread(new Runnable() {
            public void run() {
                Log.i("VJ", "Inside capture");
                byte[] EKYCmRegisterImage = new byte[SCFingerScan.this.mImageWidth * SCFingerScan.this.mImageHeight];
                long resultLEDon = SCFingerScan.this.sgfplib.SetLedOn(true);
                long result = 999L;
                if(null != SCFingerScan.this.sgfplib) {
                    result = SCFingerScan.this.sgfplib.GetImageEx(EKYCmRegisterImage, 15000L, 50L);
                }

                long resultLEDoff = SCFingerScan.this.sgfplib.SetLedOn(false);
                if(result == 0L) {
                    if(SCFingerScan.this.sgfplib.GetImageQuality((long)SCFingerScan.this.mImageWidth, (long)SCFingerScan.this.mImageHeight, EKYCmRegisterImage, SCFingerScan.this.imgQlty) == 0L) {
                        if(SCFingerScan.this.imgQlty[0] > 75) {
                            try {
                                SCFingerScan.this.mTextViewResult.setText("Image Quality is Good ");
                                SCFingerScan.this.fingerImageSuccessVisibility();
                                SCFingerScan.this.btProceed.setClickable(false);
                                result = SCFingerScan.this.sgfplib.SetTemplateFormat((short) 768);
                                SGFingerInfo e = new SGFingerInfo();
                                SCFingerScan.this.sgfplib.CreateTemplate(e, EKYCmRegisterImage, SCFingerScan.this.EKYCmRegisterTemplate);
                                
                                int[] len = new int[1];
                                result = SCFingerScan.this.sgfplib.GetTemplateSize(SCFingerScan.this.EKYCmRegisterTemplate, len);
                                byte flags = 2;
                                String base64uid = Base64.encodeToString(SCFingerScan.this.EKYCmRegisterTemplate, 0, len[0], flags);
                                SCFingerScan.this.fingerPrintData = base64uid;
                                if(SCFingerScan.this.mRequestType.equalsIgnoreCase(EnumRequestType.FINGER_AUTH.getAgency_service_name())) {
                                    LoadingUtil.animateView(SCFingerScan.this.progressOverlay, 0, 0.8F, 200);
                                    SCFingerScan.this.performAuth();
                                } else {
                                    LoadingUtil.animateView(SCFingerScan.this.progressOverlay, 0, 0.8F, 200);
                                    SCFingerScan.this.performEkyc();
                                }
                            } catch (Exception var12) {
                                Log.e("ERROR", var12.getMessage());
                                var12.printStackTrace();
                            }
                        } else {
                            SCFingerScan.this.mTextViewResult.setText("Image Quality is Bad ");
                            SCFingerScan.this.fingerImageErrorVisibility();
                        }
                    } else if(SCFingerScan.this.sgfplib.GetImageQuality((long)SCFingerScan.this.mImageWidth, (long)SCFingerScan.this.mImageHeight, EKYCmRegisterImage, SCFingerScan.this.imgQlty) == 54L) {
                        SCFingerScan.this.mTextViewResult.setText("Time OUT, Retry");
                        SCFingerScan.this.fingerImageErrorVisibility();
                    } else if(SCFingerScan.this.sgfplib.GetImageQuality((long)SCFingerScan.this.mImageWidth, (long)SCFingerScan.this.mImageHeight, EKYCmRegisterImage, SCFingerScan.this.imgQlty) == 55L) {
                        SCFingerScan.this.fingerImageErrorVisibility();
                        SCFingerScan.this.mTextViewResult.setText("Device Disconnected, Retry");
                    } else {
                        SCFingerScan.this.mTextViewResult.setText("Failed to Capture FingerPrint, Please  Retry");
                        SCFingerScan.this.fingerImageErrorVisibility();
                    }
                }

            }
        });
    }


In the above method there is one line which create template for finger data.

Also, there is another method in that class for match template
public native long MatchTemplate(byte[] var1, byte[] var2, long var3, boolean[] var5);


but I don't understand how to use this method for match two finger print data.


can anyone help me how to do that?

Is This A Good Question/Topic? 0
  • +

Page 1 of 1