Page 1 of 1

VeriFinger shows pattern class as UNKNOWN always

PostPosted: Feb 28, 2018 09:41
by INDU JOSHI
I am evaluating VeriFinger SDK. As a start, I tried to extract features from a fingerprint image. I used images from NIST-SD4 and SD14. However, the pattern class is displayed as UNKNOWN in all the images that I tried, even though the images are of decent quality. I have written the following code:
Code: Select all
         NBiometricClient biometricClient = new NBiometricClient();
         NSubject subject = new NSubject();
         NFinger finger = new NFinger();
         NImage img = NImage.fromFile(filename, fmt);
         img.setHorzResolution(horz);
         img.setVertResolution(vert);
         img.setResolutionIsAspectRatio(false);
         finger.setImage(img);
         subject.getFingers().add(finger);
         biometricClient.setFingersTemplateSize(NTemplateSize.LARGE);
         NBiometricStatus status = biometricClient.createTemplate(subject);

         if (status == NBiometricStatus.OK) {            
            NTemplate template = new NTemplate(subject.getTemplateBuffer());
            for (NFRecord nfRec : template.getFingers().getRecords()) {
               System.out.format("   pattern class: %s%n", nfRec.getPatternClass());
            }
         } else {
            System.out.format("Extraction failed: %s
", status);
         }


Please suggest a solution.

Re: VeriFinger shows pattern class as UNKNOWN always

PostPosted: Feb 28, 2018 14:11
by Martynas
Hi,

biometricClient.setFingersDeterminePatternClass(true); is missing in your code.
Take a look at provided tutorial "CalssifyFinger" to find how it is used.

Re: VeriFinger shows pattern class as UNKNOWN always

PostPosted: Mar 09, 2018 12:13
by INDU JOSHI
I made the changes as suggested in classifyfinger. However, now it is showing 'Classification failed. Status: INTERNAL_ERROR'. I had written the following code:
Code: Select all
NImage img = NImage.fromFile(filename, fmt);
         img.setHorzResolution(horz);
         img.setVertResolution(vert);
         img.setResolutionIsAspectRatio(false);
         finger.setImage(img);
         subject.getFingers().add(finger);
         biometricClient.setFingersDeterminePatternClass(true);
         task = biometricClient.createTask(EnumSet.of(NBiometricOperation.DETECT_SEGMENTS), subject);
         biometricClient.performTask(task);

         if (task.getStatus() == NBiometricStatus.OK) {
            subject.getFingers().get(1).getObjects().get(0).getPatternClass();
            System.out.format("Fingerprint pattern class is \"%s\", confidence %d\n", ((NFinger) finger.getObjects().get(0).getChild()).getObjects().get(0).getPatternClass(), ((NFinger) finger
                  .getObjects().get(0).getChild()).getObjects().get(0).getPatternClassConfidence());
         } else {
            System.out.format("Classification failed. Status: %s\n", task.getStatus());
            Throwable error = task.getError();
            if (error != null) //throw error;
            System.exit(-1);
         }

Re: VeriFinger shows pattern class as UNKNOWN always

PostPosted: Mar 13, 2018 13:58
by MartynasV
INDU JOSHI wrote:I made the changes as suggested in classifyfinger. However, now it is showing 'Classification failed. Status: INTERNAL_ERROR'. I had written the following code:
Code: Select all
NImage img = NImage.fromFile(filename, fmt);
         img.setHorzResolution(horz);
         img.setVertResolution(vert);
         img.setResolutionIsAspectRatio(false);
         finger.setImage(img);
         subject.getFingers().add(finger);
         biometricClient.setFingersDeterminePatternClass(true);
         task = biometricClient.createTask(EnumSet.of(NBiometricOperation.DETECT_SEGMENTS), subject);
         biometricClient.performTask(task);

         if (task.getStatus() == NBiometricStatus.OK) {
            subject.getFingers().get(1).getObjects().get(0).getPatternClass();
            System.out.format("Fingerprint pattern class is \"%s\", confidence %d\n", ((NFinger) finger.getObjects().get(0).getChild()).getObjects().get(0).getPatternClass(), ((NFinger) finger
                  .getObjects().get(0).getChild()).getObjects().get(0).getPatternClassConfidence());
         } else {
            System.out.format("Classification failed. Status: %s\n", task.getStatus());
            Throwable error = task.getError();
            if (error != null) //throw error;
            System.exit(-1);
         }

Hello,

Print out task.getError(), if it has inner errors, then print them out too and provide them to me(full error stack trace).

Re: VeriFinger shows pattern class as UNKNOWN always

PostPosted: Mar 17, 2018 07:57
by INDU JOSHI
Below is the error shown, when I added task.getError()
Classification failed. Status: INTERNAL_ERROR
com.neurotec.io.NFileNotFoundException: Fingers classifier model file is missing

Re: VeriFinger shows pattern class as UNKNOWN always

PostPosted: Mar 19, 2018 08:37
by MartynasV
INDU JOSHI wrote:Below is the error shown, when I added task.getError()
Classification failed. Status: INTERNAL_ERROR
com.neurotec.io.NFileNotFoundException: Fingers classifier model file is missing

Hello,

You are missing fingers .ndf file from "SDK\Bin\Data", just store it to your application's working directory.