Code Monkey home page Code Monkey logo

robertvazan / sourceafis-java Goto Github PK

View Code? Open in Web Editor NEW
236.0 21.0 99.0 2.23 MB

Fingerprint recognition engine for Java that takes a pair of human fingerprint images and returns their similarity score. Supports efficient 1:N search.

Home Page: https://sourceafis.machinezoo.com/java

License: Apache License 2.0

Java 99.38% Python 0.62%
biometrics fingerprint fingerprint-authentication java feature-extraction fingerprint-recognition minutia sourceafis

sourceafis-java's Introduction

SWUbanner

SourceAFIS for Java

Maven Central Build status Test coverage

SourceAFIS for Java is a pure Java port of SourceAFIS, an algorithm for recognition of human fingerprints. It can compare two fingerprints 1:1 or search a large database 1:N for matching fingerprint. It takes fingerprint images on input and produces similarity score on output. Similarity score is then compared to customizable match threshold.

More on homepage.

Status

Stable and maintained. Stagean is used to track progress on class and method level.

Getting started

See homepage.

Documentation

Feedback

Bug reports and pull requests are welcome. See CONTRIBUTING.md.

License

Distributed under Apache License 2.0.

sourceafis-java's People

Contributors

robertvazan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sourceafis-java's Issues

accuracy and time ?

Hi
first of all i want to appreciated you to share your nice project.

i want to know how much is your estimate for accuracy rate and searching time in 1:N identification request ?

When I try and build the code in netbeans I get the following error

Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.2.0:jar (attach-javadocs) on project sourceafis: MavenReportException: Error while generating Javadoc: Project contains Javadoc Warnings -> [Help 1]

I'm not sure what I'm doing wrong, but I used git-clone to download the files.

Unable to match images generated from Swipe and touch FP Scanners

Hello, I am using Windows Biometric Framework to capture Fingerprint data and generate a .bmp image. This image is used by SourceAFIS Matcher to match with templates.
When i generate image from a swipe scanner and try to match it against a template generated from same finger image taken from touch scanner, it always returns unmatched. Similar behavior is produced vice versa.
What can be done to overcome this?

The threshold of 40 seems risky!

Main.java

package com.scalexy.marif;

import com.machinezoo.sourceafis.FingerprintImage;
import com.machinezoo.sourceafis.FingerprintMatcher;
import com.machinezoo.sourceafis.FingerprintTemplate;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
import java.util.stream.Stream;
import java.lang.instrument.Instrumentation;

public class Main {

    private static Instrumentation instrumentation;

    public static void main(String[] args) throws IOException {
        System.out.println("Started !");
        User users[] =  new User[0];
        long pointInTime = System.nanoTime();
        File folder = new File("src/main/resources/");
        File[] listOfFiles = folder.listFiles();
        for (File file : listOfFiles) {
            if (file.isFile()) {
                pointInTime = System.nanoTime();
                byte[] tempImage = Files.readAllBytes(Paths.get(file.getAbsolutePath()));
                FingerprintTemplate tempTemplate = new FingerprintTemplate(new FingerprintImage().dpi(500).decode(tempImage));
                users = arrayUserPush(new User(file.getName(), tempTemplate), users);

                System.out.println(". Took " + ( ( System.nanoTime() - pointInTime ) / 1000000 ) + " ms");
            }
        }
        for (User user1 : users) {
            FingerprintMatcher user1Probe = new FingerprintMatcher().index(user1.template);
            for (User user2 : users) {
                pointInTime = System.nanoTime();
                double score = user1Probe.match(user2.template);
                if(score > 40) {
                    String user1FingerId = user1.filename.substring(0, 5);
                    String user2FingerId = user2.filename.substring(0, 5);
                    String user1Id = user1.filename.substring(0, 3);
                    String user2Id = user2.filename.substring(0, 3);
                    if(!user1FingerId.equals(user2FingerId)){
                        System.out.println("Mismatched fingers");
                        System.out.println("Took " + ((System.nanoTime() - pointInTime) / 1000000) + " ms to calculate score of " + score + " between " + user1.filename + "[" + user1FingerId + "] and " + user2.filename + "[" + user2FingerId + "]");
                    }
                    if(!user1Id.equals(user2Id)) {
                        System.out.println("Mismatched users");
                        System.out.println("Took " + ((System.nanoTime() - pointInTime) / 1000000) + " ms to calculate score of " + score + " between " + user1.filename + "[" + user1FingerId + "] and " + user2.filename + "[" + user2FingerId + "]");
                    }
//                    System.out.println("Took " + ((System.nanoTime() - pointInTime) / 1000000) + " ms to calculate score of " + score + " between " + user1.filename + "[" + user1FingerId + "] and " + user2.filename + "[" + user2FingerId + "]");
                }
            }
        }

//        FingerprintTemplate f012_3_1 =
//
//        double score = new FingerprintMatcher()
//                .index(probe)
//                .match(candidate);
        System.out.println("Ended with score of " + 0 + "!");
    }
    public static void addToTemplates(Path path) {
        System.out.println(path);
    }

    public static User[] arrayUserPush(User item, User[] oldArray) {
        int len = oldArray.length;
        User[] newArray = new User[len+1];
        System.arraycopy(oldArray, 0, newArray, 0, len);
        newArray[len] = item;
        return newArray;
    }
}

User.java

package com.scalexy.marif;

import com.machinezoo.sourceafis.FingerprintTemplate;

import java.io.File;

public class User {
    public String filename;
    public FingerprintTemplate template;
    public User(String filename, FingerprintTemplate template) {
        this.filename = filename;
        this.template = template;
    }
}

Problem section of console output

Mismatched fingers
Took 0 ms to calculate score of 46.83419575414075 between 045_6_4.tif[045_6] and 013_6_6.tif[013_6]
Mismatched users
Took 0 ms to calculate score of 46.83419575414075 between 045_6_4.tif[045_6] and 013_6_6.tif[013_6]
Mismatched fingers
Took 0 ms to calculate score of 47.15536445186042 between 045_4_7.tif[045_4] and 045_8_2.tif[045_8]
Mismatched fingers
Took 0 ms to calculate score of 48.89576763560057 between 012_5_2.tif[012_5] and 017_4_7.tif[017_4]
Mismatched users
Took 0 ms to calculate score of 48.89576763560057 between 012_5_2.tif[012_5] and 017_4_7.tif[017_4]
Mismatched fingers
Took 0 ms to calculate score of 40.19906861819457 between 013_4_3.tif[013_4] and 017_4_2.tif[017_4]
Mismatched users
Took 0 ms to calculate score of 40.19906861819457 between 013_4_3.tif[013_4] and 017_4_2.tif[017_4]
Mismatched fingers
Took 0 ms to calculate score of 50.304437365351085 between 047_4_6.tif[047_4] and 047_3_5.tif[047_3]
Mismatched fingers
Took 0 ms to calculate score of 46.83419575414075 between 013_6_6.tif[013_6] and 045_6_4.tif[045_6]
Mismatched users
Took 0 ms to calculate score of 46.83419575414075 between 013_6_6.tif[013_6] and 045_6_4.tif[045_6]
Mismatched fingers
Took 0 ms to calculate score of 42.09368749239653 between 012_8_2.tif[012_8] and 017_7_7.tif[017_7]
Mismatched users
Took 0 ms to calculate score of 42.09368749239653 between 012_8_2.tif[012_8] and 017_7_7.tif[017_7]
Mismatched fingers
Took 0 ms to calculate score of 48.89576763560057 between 017_4_7.tif[017_4] and 012_5_2.tif[012_5]
Mismatched users
Took 0 ms to calculate score of 48.89576763560057 between 017_4_7.tif[017_4] and 012_5_2.tif[012_5]

The threshold of 40 is triggering false positives. This is nowhere close to 0.01 FAR. Or am I doing something wrong?

error when running this code

File sdCard = Environment.getExternalStorageDirectory();
File dir = new File(sdCard.getAbsolutePath() + "/rio/1541183782271.jpg");

            Bitmap probe = BitmapFactory.decodeFile(dir.getAbsolutePath());

            ByteArrayOutputStream stream = new ByteArrayOutputStream();

            probe.compress(Bitmap.CompressFormat.PNG, 100, stream);

            probeImage = stream.toByteArray();
            stream.reset();


            probeTemplate = new FingerprintTemplate()
                    .dpi(500).create(probeImage);

            sdCard = Environment.getExternalStorageDirectory();
            dir = new File(sdCard.getAbsolutePath() + "/rio/1541183782271.jpg");

            Bitmap candidate = BitmapFactory.decodeFile(dir.getAbsolutePath());


            stream = new ByteArrayOutputStream();

            candidate.compress(Bitmap.CompressFormat.PNG, 100, stream);

            candidateImage = stream.toByteArray();
            stream.reset();


            candidateTemplate = new FingerprintTemplate()
                    .dpi(500).create(candidateImage);

            double score = fm.index(candidateTemplate).match(candidateTemplate);

the error is:

11-10 23:28:00.681 7602-7602/com.belleindonesia.fingerprint2 E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.belleindonesia.fingerprint2, PID: 7602
java.lang.NoClassDefFoundError: Failed resolution of: [Ljava/util/function/Function;
at com.machinezoo.sourceafis.TemplateBuilder.decodeImage(TemplateBuilder.java:151)
at com.machinezoo.sourceafis.TemplateBuilder.extract(TemplateBuilder.java:25)
at com.machinezoo.sourceafis.FingerprintTemplate.create(FingerprintTemplate.java:97)
at com.belleindonesia.fingerprint2.MainActivity$5.onClick(MainActivity.java:248)
at android.view.View.performClick(View.java:4781)
at android.view.View$PerformClick.run(View.java:19874)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:697)
Caused by: java.lang.ClassNotFoundException: Didn't find class "java.util.function.Function" on path: DexPathList[[zip file "/data/app/com.belleindonesia.fingerprint2-1/base.apk", zip file "/data/app/com.belleindonesia.fingerprint2-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.belleindonesia.fingerprint2-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.belleindonesia.fingerprint2-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.belleindonesia.fingerprint2-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.belleindonesia.fingerprint2-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.belleindonesia.fingerprint2-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.belleindonesia.fingerprint2-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.belleindonesia.fingerprint2-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.belleindonesia.fingerprint2-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.belleindonesia.fingerprint2-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.belleindonesia.fingerprint2-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.belleindonesia.fingerprint2-1/lib/arm, /vendor/lib, /system/lib, /data/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at com.machinezoo.sourceafis.TemplateBuilder.decodeImage(TemplateBuilder.java:151)ย 
at com.machinezoo.sourceafis.TemplateBuilder.extract(TemplateBuilder.java:25)ย 
at com.machinezoo.sourceafis.FingerprintTemplate.create(FingerprintTemplate.java:97)ย 
at com.belleindonesia.fingerprint2.MainActivity$5.onClick(MainActivity.java:248)ย 
at android.view.View.performClick(View.java:4781)ย 
at android.view.View$PerformClick.run(View.java:19874)ย 
at android.os.Handler.handleCallback(Handler.java:739)ย 
at android.os.Handler.dispatchMessage(Handler.java:95)ย 
at android.os.Looper.loop(Looper.java:135)ย 
at android.app.ActivityThread.main(ActivityThread.java:5254)ย 
at java.lang.reflect.Method.invoke(Native Method)ย 
at java.lang.reflect.Method.invoke(Method.java:372)ย 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902)ย 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:697)ย 
Suppressed: java.lang.ClassNotFoundException: java.util.function.Function
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 15 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

.....

please help me, im new developer

Different scores when interchanging probe and candidate for matching (color fingerprint photos)

Hi,

First of all, thank you very much for your sharing a such project.

But I find out a problem when I try to match 2 fingerprint images (in color) (A and B) and A.match(B) != B.match(A). You can in see the below photos. I try different color fingerprint photo couples, the problem still remains. I don't meet this problem when doing the same experiments with gray images.

I wonder if SourceAFIS does not support images in color. May you help me clear this point please!

Thank you in advance!

image
image

Core and Delta detection

Hello Robert!

What about core and delta? Would the system be more accurate if those were located?

Matching between two template ansi/iso?

Hello my friend's, today i have a dude, ยฟhow do i compare two template ansi or iso?, that is, in my database of a bank, we save the template ansi, and we want matching templates, but I've seen only matching images and those images take their minutiae and compare them, but how would you do to just compare templates ansi / iso after using convert on the fingerprintimage.

Is SourceAFIS portable to embedded systems? (C/C++)

Nice to see the repo still maintained.

I'm looking into using this source code for performing 1:1 matching using the same kind of fingerprint sensor found in smartphones, but placed into a 32-bit ARM micro controller (limited RAM ~128kb)
The fingerprint sensor outputs individual pixels, roughly 160*160px

Any possibility of porting this into an embedded system?
Or does this require too much RAM or rely on advanced libraries?

What recommended score?

I did two 3 tests with very different results and I would like to know the recommended score to say that the fingerprint belongs to the person. For they are numbers that at first seem strange to me, for example, in the case of the same templates I expected something like a round number (maximum score).

First - Equal templates:

String template1 = "Rk1SACAyMAAAAACuAAABBAEsAMUAxQEAAAAAGEBFAEzxZEBQAFX3ZEBuAG95XUCZAHPmZECHAHvjXUBvAILvXUB7AIdxXYBHAIj3ZIAnAImOZEAyAJeRZECkAJ1hZEBLAJ6LZECpALHXZEBBALqdZIAVAL0aZEBRAMXXZICIAMvJZECoANfMZIAqAO2/XUBrAO2/ZIAbAQzBXYBCARBCXUCMARO9ZIBOARc8XQAA";
String template2 = "Rk1SACAyMAAAAACuAAABBAEsAMUAxQEAAAAAGEBFAEzxZEBQAFX3ZEBuAG95XUCZAHPmZECHAHvjXUBvAILvXUB7AIdxXYBHAIj3ZIAnAImOZEAyAJeRZECkAJ1hZEBLAJ6LZECpALHXZEBBALqdZIAVAL0aZEBRAMXXZICIAMvJZECoANfMZIAqAO2/XUBrAO2/ZIAbAQzBXYBCARBCXUCMARO9ZIBOARc8XQAA";

byte[] template1BytesArray = Base64.getDecoder().decode(template1.getBytes());
byte[] template2BytesArray = Base64.getDecoder().decode(template2.getBytes());


FingerprintTemplate probe = FingerprintCompatibility.convert(template1BytesArray);
FingerprintTemplate candidate = FingerprintCompatibility.convert(template2BytesArray);

FingerprintMatcher matcher = new FingerprintMatcher()
        .index(probe);

double score = matcher
        .match(candidate);

System.out.println(score);

Score: 291.9119373012775


Second - Another reading same finger

String template1 = "Rk1SACAyMAAAAACuAAABBAEsAMUAxQEAAAAAGEBFAEzxZEBQAFX3ZEBuAG95XUCZAHPmZECHAHvjXUBvAILvXUB7AIdxXYBHAIj3ZIAnAImOZEAyAJeRZECkAJ1hZEBLAJ6LZECpALHXZEBBALqdZIAVAL0aZEBRAMXXZICIAMvJZECoANfMZIAqAO2/XUBrAO2/ZIAbAQzBXYBCARBCXUCMARO9ZIBOARc8XQAA";
String template2 = "Rk1SACAyMAAAAADMAAABBAEsAMUAxQEAAAAAHYByAC93ZICdAD90ZIBtAEb0ZEAkAFaAZEBBAFz3ZEBjAHF5ZICTAHHoZIA3AHJ8ZEB+AH3kXYBoAIrvXYBCAIz2ZIAkAI6NZIByAI5vXUArAJySZECfAKJhZIBDAKeNZECgALHbZEA8AMCdZIAOAMQbZIBHAM3cV4CCAM7MZICfANvPZEByAOjEXYBrAO9LXYAmAPK/ZIBsAPq/XYCrAQnJZEASARDGZECKARTBZAAA";

Score: 156.51953517265258


Third - Another person's finger

String template1 = "Rk1SACAyMAAAAACuAAABBAEsAMUAxQEAAAAAGEBFAEzxZEBQAFX3ZEBuAG95XUCZAHPmZECHAHvjXUBvAILvXUB7AIdxXYBHAIj3ZIAnAImOZEAyAJeRZECkAJ1hZEBLAJ6LZECpALHXZEBBALqdZIAVAL0aZEBRAMXXZICIAMvJZECoANfMZIAqAO2/XUBrAO2/ZIAbAQzBXYBCARBCXUCMARO9ZIBOARc8XQAA";
String template2 = "Rk1SACAyMAAAAADeAAABBAEsAMUAxQEAAAAAIIBNABGNZEBGAB0OZEBNACiQZEB1AEj/ZIC/AEp0ZICLAE/zZEDIAFXrZIB0AGX5XUBdAGmgXUCPAHrlZIA/AH2pXYCAAIGPZEDPAILhZEBFAIysZEBuAJf3ZIBTAJuyZICYAJ7QZEC0AKDSZIAuAKYsZIB9AKfHZEDRAKrTZEDoALjUZIAcAMW4ZEDZANXIZEC+AOa9ZED1AOlNXUB5AOpGUIDoAOvKXYCBAPA9UIDPAPW9ZIBZAPbVXUDwAQJMXQAA";

Score: 13.448608393232206

I configured my biometric reader to export in ISO format without proprietary information and it looks OK, since FingerprintCompatibility did not report any errors.

Java Android - Error during APK Build

Kindly help, I get this error during APK guild, the app works fine during debug run.
I have updated gradle to version 7.4 and Android Gradle Plugin Version to 7.3.0-alpha03

One or more instruction is preventing default interface method from being desugared: java.lang.Double it.unimi.dsi.fastutil.objects.Reference2DoubleMap.getOrDefault(java.lang.Object, java.lang.Double)

Not getting score above 10 by using FingerprintMatcher

Hello,
Im using FingerprintMatcher to get the score >40. but im not able to get.
Please suggest me any solution.

This is my sample code:
ByteArrayOutputStream stream = new ByteArrayOutputStream();
Bitmap bitmap = PictureUtility.drawableToBitmap(imgCapture.getDrawable());
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, stream);
FingerprintTemplate probe = new FingerprintTemplate().create(stream.toByteArray()).dpi(500);

                Bitmap bitmap1 = ((BitmapDrawable) fingerPrintView.getDrawable()).getBitmap();
				showAlert("bitmap1", "databseImage " + probe);
				//Bitmap bitmap1 = ((
				ByteArrayOutputStream stream1 = new ByteArrayOutputStream();
				bitmap1.compress(Bitmap.CompressFormat.JPEG, 100, stream1);
				FingerprintTemplate candidate = new FingerprintTemplate().create(stream1.toByteArray()).dpi(500);
				showAlert("bitmap1", "databseImage " + candidate);
				System.out.println("candidate++ " + Arrays.toString(candidate.toByteArray()));
				double score = new FingerprintMatcher()
						.index(probe)
						.match(candidate);

Hex form tamplate data:

hexDataprobe 1F8B08000000000000008D56CB6E1C3710FC97392F887E37B9BF12E4605B8AB58728812227310CFDBB6B34DCC4216706810E02A4656D77D7A3FBDBF2F478FBFCF4BA5C8DE8B2FC7A7BFEF27AFBF0B85C7FFAB63CDC5E1E3FBDDE7E7B5EAE52AA13AB576FCCDC24ECB2BC7EFD1D9F5B3EDE7EF9F2F2E9C3FBE72ECBDFCB35EB65F9BA5C3DDE2EFFC1E042CEE1242C6E5553EB3186B5770C69348078A9DC5C335AE5AC790291B641581D20B488B1042B05556AEEC7184CBD0E9309C419D0DA4C8CC44E41B857A223089556259B26FE65A9D24E408436101E41BC2891367614A3229EFF96F2F8FC707BFEDC016C03501AE761C543AD3552C974907BD28BD046AEE4C8AE9748CCA1A9A123D2CCDD2A94DF9FB3B4491C0E6CC5309852C0F009B3DA47913E91C2C60E753A94DA80B55BC3FAE7F5798C354831E3682DABD624B716FB93D4D826C93C033000A43537AD149C274D6CCA8A918D28A45528C28C5C52E44C135B273A72114514520878D53C817482D19BA9B33669B7FBDA9B4F9B9A0F8E6C516150C52F3F98DE5DC831564DC58D0CEE26128CBF9AEC03786E1AF2B96431037B110A7FD7303E6BBC3722338A8954D7B6468434A37D25736CC387AF26298750BA813BE41D5C79960D7E4FA9711A0818115A5D4989C8F4133F086D23659A23F7B0941F7BB903C8A4022E19E0936B5D059999B60FC0D2C365AC4060C9E4449FC8FBA0FFE16A1A6D49055E720A640A43F2612731195B1D48C1D99A014DA212283EE447562710EF213571729C71334617E9A4F2285C1564841BAC82ED71B67D7A2193D7AC90A8054A11E44D95BA6FD59EF85356736994A0051D72E510DD7FCFD6A73985941487281DE3D474D83EF44CE23DA5681497A10CD8D5607B74E3473EEB45B4F139A4053DC019480B4C1379BB0FD0EF11ACD849586CB5D6D62C831A92E36CF3FD13173A89222187707C3FDA4176ED2F1DEF4318D5EDA5593893D5CC86DC3913F78631E59E23B1A01517FCAC06D91783F72364272392A0A5B67E7D2077E364087DFBEB9879B4DE100AAE82AD31D29F0FC27F03E0E9AE83A24062E0BC44DC809083DD0DF71EDC1F5A3223B07A4068253E4A6DBF9F51A3A44F627F6777F0FEF2A6521B4688EB057266356DFB71295BEAF34EDEAA382E5B380A71858B6C9F4CD13B9BB31612CF0C291A10431EBCEFB7B1CE29B94652544C11C9B0CAE28085FEF53E9F71CD7158C3918A8891D30B88B373D1464B618C469864AC4B1CAAF20335B5AEA6D4B79F2FCB9F8F2F7FBC3F5FA0057CE2AFDBC3EBD35A64BC7D07171D6ACEE60C0000

hexDataCandidate:

hexDatacandidate 1F8B08000000000000008D56CB6E1C3710FC97392F887E37B9BF12E4605B8AB58728812227310CFDBB6B34DCC4216706810E02A4656D77D7A3FBDBF2F478FBFCF4BA5C8DE8B2FC7A7BFEF27AFBF0B85C7FFAB63CDC5E1E3FBDDE7E7B5EAE52AA13AB576FCCDC24ECB2BC7EFD1D9F5B3EDE7EF9F2F2E9C3FBE72ECBDFCB35EB65F9BA5C3DDE2EFFC1E042CEE1242C6E5553EB3186B5770C69348078A9DC5C335AE5AC790291B641581D20B488B1042B05556AEEC7184CBD0E9309C419D0DA4C8CC44E41B857A223089556259B26FE65A9D24E408436101E41BC2891367614A3229EFF96F2F8FC707BFEDC016C03501AE761C543AD3552C974907BD28BD046AEE4C8AE9748CCA1A9A123D2CCDD2A94DF9FB3B4491C0E6CC5309852C0F009B3DA47913E91C2C60E753A94DA80B55BC3FAE7F5798C354831E3682DABD624B716FB93D4D826C93C033000A43537AD149C274D6CCA8A918D28A45528C28C5C52E44C135B273A72114514520878D53C817482D19BA9B33669B7FBDA9B4F9B9A0F8E6C516150C52F3F98DE5DC831564DC58D0CEE26128CBF9AEC03786E1AF2B96431037B110A7FD7303E6BBC3722338A8954D7B6468434A37D25736CC387AF26298750BA813BE41D5C79960D7E4FA9711A0818115A5D4989C8F4133F086D23659A23F7B0941F7BB903C8A4022E19E0936B5D059999B60FC0D2C365AC4060C9E4449FC8FBA0FFE16A1A6D49055E720A640A43F2612731195B1D48C1D99A014DA212283EE447562710EF213571729C71334617E9A4F2285C1564841BAC82ED71B67D7A2193D7AC90A8054A11E44D95BA6FD59EF85356736994A0051D72E510DD7FCFD6A73985941487281DE3D474D83EF44CE23DA5681497A10CD8D5607B74E3473EEB45B4F139A4053DC019480B4C1379BB0FD0EF11ACD849586CB5D6D62C831A92E36CF3FD13173A89222187707C3FDA4176ED2F1DEF4318D5EDA5593893D5CC86DC3913F78631E59E23B1A01517FCAC06D91783F72364272392A0A5B67E7D2077E364087DFBEB9879B4DE100AAE82AD31D29F0FC27F03E0E9AE83A24062E0BC44DC809083DD0DF71EDC1F5A3223B07A4068253E4A6DBF9F51A3A44F627F6777F0FEF2A6521B4688EB057266356DFB71295BEAF34EDEAA382E5B380A71858B6C9F4CD13B9BB31612CF0C291A10431EBCEFB7B1CE29B94652544C11C9B0CAE28085FEF53E9F71CD7158C3918A8891D30B88B373D1464B618C469864AC4B1CAAF20335B5AEA6D4B79F2FCB9F8F2F7FBC3F5FA0057CE2AFDBC3EBD35A64BC7D07171D6ACEE60C0000

Unsupported image format

Hi !!! I'm working about fingerprint verificaition now, and I have a problem about the image format.

I have Intellij as IDE, and using sourceafis-3.8.1.jar.
Below my sample code:

try {
FingerprintTemplate probe = new FingerprintTemplate (
new FingerprintImage ()
.dpi ( 500 )
.decode (Files.readAllBytes (Paths.get ( "src/image1.jpg" ))));
FingerprintTemplate candidate = new FingerprintTemplate (
new FingerprintImage ()
.dpi ( 500 )
.decode (Files.readAllBytes (Paths.get ( "src/image2.jpg" ))));
}
And the error is like this:
Exception in thread "main" java.lang.IllegalArgumentException: Unsupported image format [ImageIO = 'java.lang.NoClassDefFoundError: com/machinezoo/noexception/Exceptions -> java.lang.ClassNotFoundException: com.machinezoo.noexception.Exceptions', Sanselan = 'java.lang.NoClassDefFoundError: com/machinezoo/noexception/Exceptions -> java.lang.ClassNotFoundException: com.machinezoo.noexception.Exceptions', WSQ = 'java.lang.IllegalArgumentException: This is not a WSQ image.', Android = 'java.lang.UnsupportedOperationException: Image decoder is not available.'].
at com.machinezoo.sourceafis.ImageDecoder.decodeAny(ImageDecoder.java:79)
at com.machinezoo.sourceafis.FingerprintImage.decode(FingerprintImage.java:84)
at MaintTest.main(MaintTest.java:17)

Segmentation of multi-finger images

Hello,
Thank you for this excellent library.
I have tried it with Java and I could get right results when I compared two images which include fingerprint.
I want to know if there are any methods to be called to get the count of fingerprints in one image and the positions of every fingerprint in the image.
I also want to know if there are any methods to be called to get the quality of the fingerprint in one image. I saw the post here: https://sourceforge.net/p/sourceafis/discussion/1051112/thread/38d9d4ffea/?limit=25.
However, after I readed it, I still donot know how to get the quality of the fingerprint in my code.

How can I compare two fingerprints?

Hi!

First of all thanks for your code!
I am developing an educational project and I have two compare fingerprints based on ISO templates.
For example:

Attempting to load #3
Template 3 loaded
Attempting to get #3
Template 3 transferring:
534 bytes read.
Decoding packet...
FFFFFFFFFFFFFFFFFF01571A7F00F01EC00E00060006000200020002000200020002000600060006031EEF01FFFFFFFF0200220006000E000E001E000000000000000000000000000000003108613E170C9F5E025CEF01FFFFFFFF0200220D8D9E5E22189F7E3C201E3E2AA8059E44321A7E62B66A162EB7DB5E493CC13E0B86EF01FFFFFFFF02002208C1061E5F27E93F662A959F23C1045F30C1C2BF18B5C53C501D2B1D17B8DCBD0D27EF01FFFFFFFF02002242AB42DA3E2CDBBA16AD855A1C2E9CBA400CC7DB551A1C954F119DF052101ED10DBAEF01FFFFFFFF02002200000000000000000000000000000000000000000000000000000000000000000024EF01FFFFFFFF0200FFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000000000000024EF01FFFFFFFF02002200000000000000000000000000000000000000000000000000000000000000000024EF01FFFFFFFF0200220301581D7F00F006E002800080008000000000000000000000000000800080000574EF01FFFFFFFF02002280008000C000E0060000000000000000000000000000000039051F96200B1E16041CEF01FFFFFFFF020022168D1DD62E179EBE5E1AA99E499D5D5E129D9D3E27ACC59E562ED97E762FA9760E1AEF01FFFFFFFF02002242355A7E75B5551E29385BFE5EB8EC7E4ABE819E3C41029E6414225F39A504
done.
------------------------------------
Attempting to load #4
Communication error
------------------------------------
Attempting to load #5
Template 5 loaded
Attempting to get #5
Template 5 transferring:
534 bytes read.
Decoding packet...
FFFFFFFFFFFFFFFFFF0156128400C0FE001E001E001E000E000E000E000E000E000E000E000E001E03BAEF01FFFFFFFF020022003E003E003E007E000000000000000000000000000000000B0B657E190CE6DE043EEF01FFFFFFFF0200220D19E4FE0B9F24BE19B1A93E411CA2FF1838563F5911A23C5E9362FC0926A05D0D0FEF01FFFFFFFF0200222B100DDB390BCAF8132365D81725E6F80E24E3B916A85699368493F42B930DF50E56EF01FFFFFFFF02002200000000000000000000000000000000000000000000000000000000000000000024EF01FFFFFFFF02002200000000000000000000000000000000000000000000000000000000000000000024EF01FFFFFFFF0200FFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000000000000024EF01FFFFFFFF02002200000000000000000000000000000000000000000000000000000000000000000024EF01FFFFFFFF02002203014C127B00E0FEC0FE800E800600020002000200020002000200060006000E05D7EF01FFFFFFFF020022000E000E001E803E00000000000000000000000000000000208EE53E3111E6BE04D3EF01FFFFFFFF0200226A9462B63E178F5E239DE4BE191FE39E0822A29E10AEDFBE09361D1E2FB668FE0E21EF01FFFFFFFF020022293B96FE55A022BF2424A43B202AE0353F130F722A2765F02D2D57EF48120B
done.

How can I compare the two above fingerprints using the sourceAfis software?

Thanks in advance

FingerprintTemplate Format

Hi..
I want to store the fingerprint template in database, I used Cassandra database and set the data type of the fingerprint template as BLOB. But it didn't worked.
So, could you tell me which data type should I use if I want to store the fingerprint template into a database?
Thanks!!!

Fingerprint quality metric

Is there a way to determine if a fingerprint is of value, meaning the image is good enough to be read/matched. Some use cases are: a partial fingerprint or may be something that is partially smudged?

compile an example with android

Why would this error be when trying to compile an example with android?
captura de pantalla 2018-02-08 a la s 12 53 55

`apply plugin: 'com.android.application'

android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.gabrielmunoz.digitalpersona"
minSdkVersion 14
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
compile 'asia.kanopi.tools:fingerscan:0.1'
compile 'com.machinezoo.sourceafis:sourceafis:2.2.0'

}
`

Large scale database

What's the best way to use sourceafis for large scale databases?
I want to authenticate users login to system using their fingerprint.
do you have any idea ?

Do we really need to check pixel buffer size?

FingerprintImage constructor throws an exception if pixels.Length != width * height I think this it pointless because I may reuse the buffer for multiple images and the size does not have to match. With this check it is not possible to reuse the buffer.

        public FingerprintImage(int width, int height, byte[] pixels, FingerprintImageOptions options = null)
        {
            if (pixels == null)
                throw new ArgumentNullException(nameof(pixels));
            if (width <= 0 || height <= 0 || pixels.Length != width * height)
                throw new ArgumentOutOfRangeException();
            Matrix = new DoubleMatrix(width, height);
            for (int y = 0; y < height; ++y)
                for (int x = 0; x < width; ++x)
                    Matrix[x, y] = 1 - pixels[y * width + x] / 255.0;
            if (options == null)
                options = new FingerprintImageOptions();
            Dpi = options.Dpi;
        }

Caching fingerprint templates

Hi, I have a question, how can I deserialize the templates in the zip file.
i used this:

byte[] serialized = Files.readAllBytes(Paths.get("fingerprint.json.gz"));

FingerprintTemplate template = new FingerprintTemplate(serialized);

but I get this error, could you help me.

Captur1111a

Matching Speed

Hi
I can't reach a speed of 12500fp/s per core my processor is 2.19GHz see my code below

FingerprintMatcher matcher = new FingerprintMatcher(probe);
UserDetails match = null;
double high = 0;
AtomicReference highAtom = new AtomicReference<>((double) 0);
logger.info("Start parallel comparing finge");
long startTime = System.currentTimeMillis();
candidates.parallelStream().forEach(candidate -> {
double score = matcher.match(returnTemplateFromBytre(candidate.getFingerPrint()));
if (score > highAtom.get()) {
highAtom.set(score);
// match = candidate;
}
});
logger.info("End parallel comparing finge "+highAtom.get());
long stopTime = System.currentTimeMillis();
logger.info("parallel solution time: " + (stopTime - startTime));

Unsupport image format

Hi Robert๏ผŒIs possible to support other format of finger print image, now only i have tif or bmp file image, i can't conver the tif filw to raw image,do you have any suggestion? thank you.
Exception in thread "main" java.lang.IllegalArgumentException: Unsupported image format
at com.machinezoo.sourceafis.TemplateBuilder.readImage(TemplateBuilder.java:136)
at com.machinezoo.sourceafis.TemplateBuilder.extract(TemplateBuilder.java:19)
at com.machinezoo.sourceafis.FingerprintTemplate.create(FingerprintTemplate.java:92)

Java 1.7 compatible version

Hey there,
your library is probably the best I've come across after nearly a week of searching for a way to transform fingerprint images into templates for matching.
Unfortunately, the Android device I'm working with does not allow me to use certain Java 8 features. Do you have an older version of this library I can fallback on?
All I've seen so far are 2.x alpha releases...

Expose minutiae details

Would it be possible to expose the "minutiae" information in some meaningful way on the FingerprintTemplate? We have a need to render minutiae information as an overlay onto the fingerprint image itself. It appears this information is inside the Immutable object, but that object is unvailable for reading data from. Perhaps some form of the minutiae information could be exposed externally to a caller or available via subclass?

Build error on android kotlin

Getting this issue "com.android.tools.r8.errors.b: One or more instruction is preventing default interface method from being desugared: java.lang.Double it.unimi.dsi.fastutil.objects.Reference2DoubleMap.getOrDefault(java.lang.Object, java.lang.Double)" on android kotlin when I try to build the project or generate an APK

Support for Android

Hi Robert,

Is it possible that this source code can work in Android?

By the way, in FingerPrintContext class. I always received an error in radius, majority and borderDist.

It seems these three does not exists in Voting Parameter Class as a method but as a properties.

Fingerprint Template Format Issue

In my JavaFX project I added all necessary .jar files and trying to generate template using the sample images downloaded from NIST and using the following code :

try {
byte[] image = Files.readAllBytes(path);
FingerprintTemplate template = new FingerprintTemplate(
new FingerprintImage()
.dpi(500)
.decode(image));
byte[] serialized = template.toByteArray();
System.out.println(serialized.toString());
}
catch(IOException e) {
}

The printed result is : [B@3ea9107,
I think this is wrong because as I read the result should be a long hash !

Match/compare two fingerprint templates

I want to test a string (captured by the digital biometric device) and I want to compare it with other templates. In the examples I only found opening an image, I want to pass the string directly, because I already have the template string.
I want to know the comparison score or if it's the same finger.
How should I do?

Below two readings from the same finger:


SUNSUzIxAAADmAEBAAAAAMUAxQAEASwBAAAAg2odhgASABsPcgAgAB4ONAApAA0PHQAzAHQPjQBBAKAPNABFAHUPkABSACcPMQBhAGUPPABnACQPdABuADUPNQB1ADIOkgB3ADIPYwCHAD0OFgCLAEQPXgCXAD4NmACmADoPeQCvAEcPtQCyADgPNgDAAMcMZADAAMIPgQDAAEUPaQDLAEwPWADMAFgPcADMAMYPGADeALANLgDfAOkNRgDhAHYORwAKAekPeAAUAeEPzf6jfKP3SQaKg4/75Zq1m7eq/WopAz8RGXiGh5+EzWtRE6kDFYia9br2MENVNeHz8MOx9BaxpvhaBC4SIRAJzbby2vwODYv4kQAeCHP4JhYX4R8hEQBi+X5+WgS+9Kb1aQWdh4aA2gC/9s/zBuDKcepR7HshbOH86QGlgan7OIrkj7H0CZglDCmWQH5dBKGB0cqy69c8GTqddmIkjY7pI7qxWnZDAaMJK/lDb18fUjnLHCA6AQIEGEYKAG0AE2A+ZAQAngAWNAgAfwEQO1YHAI8BE/84wAwAYwMT/0zB/mX/DwBNCP37PlRS/jQFADMKCV4JACcQBlT+/0AIAIgUGlRYBQAdGgA4CwB2HhzAQ1VBEgAeIwPC/f3AQcBDPk8DAHQkHsAFAF0lF/5XCgA4KQz////+wD4YABctA8IiNf//OP9V/8D+/ykcAAxB8cH8J8D+Pv1XUzv+MzoEAC9Fd40JAJFFIMD/VTYPAARR5P3B+/zA/v/9wPvCRggAlFMiQkAIAI9WJ2BKCwAtYWuXwMOHwhEAA2XgMf77/cD8//7B//7//wQAOGZ0xMMDAEBmGv0JADJuF/z9KCcHAC9xYsSdwxIAdHEx/8D+aMH9MypMCwAEctcn/f37/yoGADF5WsXBoAYAN3ktI/8JAJZ6LUzALwgAkHs0wf9PwQsAW4a6w8PEw8LGwcLDAwAwiEPBBAA2iDo2CQBaiEA///78/AUAZ4o6//7BBwBSjEZHJgoAEo5Ml//CwrcGABiOQ4vAAwBdqEbCBwCYqjQvLwMQlABW/AkAfbJA/cE7KgMAtLU9wAsAgMNA/jv9//07CQBkxEYqI/0HAGnPSf7+/icFAFrQUywGAHDQRir9BAEB3EzCwAYADd0awMXEwwUApORJ///+AwAS6xrDAxB0F2v+BBCOF3A0AERCAQEAAAAWAAAAAAIFAAAAAAAARUI=


SUNSUzIxAAADMAEBAAAAAMUAxQAEASwBAAAAgwIXvgBMAI4PkgBPABEPYABmAAkOiAB5AIoOlAB6ABsOrwB9ABoPhwCQABEOYACVAAkPkwCVAJEOSgCgAHQPuwCnAJ8PYQCrAHQPvgC4ACgPWgDEAGQOnQDVADQPvwDeADMPkQDsADwPfwDzALEPQwD5AEEPhwD7AEIPxQATAUEPWgAYAcIPpgAaAUIPcn9DdVN3rvu6i26HioO7AGf6+HM5eir46JO9D6mP7QPKie6SgIMxikX7tZbllnL6gIOxe6II+W4hAj4SHXiWh3YTzW6hAlkTEYia9r736fPO8uNcoftaAa6H2gEODsP4nf21jRkL8HPBdbJ/ZoIT3z+T4JMZCWIDugD/EdsHZoKjEauCNgDiA+8JqPZLIDYBAeUXKAMAujQXwAUArjcTwToHAKA5ED1dAwCbQAzACgCWRA9bPk8OAGdIA1c+REEQAFNKCf7Bwv3AVEf+VwwAdU4GL8DA/sE1EABHUAZQ/ldX/1QLAJRQEMBERP7/CQBGWQb9xf3//0cEAEVhDFURAGNmBv/+U/7ARP/AwDcEAFh0Az0LADh6BsI9wP4rBQCMexrASgwAl3waR0TAwD4HALN8Fj5MCgCygRr/wP9VNwwAPIMDwjXA/v4+FAA6iwPAw/0r//5BW/9GCAB2lRBANQ8AZJcJMzj///7AwPzCEABOn/r9My//K0YFAFyrd8NrCQC+qyA+R/8IAMK6JP//wMBACAC+vCtXwEYMACbB4v48+/8z/wcAVsJrwsJ+BwBewwP9+/4gCQBYyGnDwcP+w5oJAGXMcZ9hwQQAcs0kKgMAbNIk/gcAodcwQGQFAJzYN8BGBwDD4DHAQ/0GAL7hN8DBQQcAXOIW+f0wEwAh5cn8/f/A/v79/P3A/f3BwP7//g0AkOi3w8LCxMLEw8HBwsEFAFbqTJIFAGHuN/4pBABc70N1BQCP8D09BQCV8DpABQB/90ZPBAD8+kM9BAAK/EPE/gQAQv1DkQQAhv9GSgQAi/9APg8QUyqwMP3++/cW/y9EQgEBAAAAFgAAAAACBQAAAAAAAEVC


Struggling to get json from FingerprintTransparency

I am trying to extract the "shuffled-minutiae" json information as of your example. I can't seem to find details on what is the "content" and how to turn "content" into a string that I can then extract data from. It is byte format, so what is the process to convert it into string format. Is it gzip -> base64 -> string ...? I have other code where i played with this but could not work it out.

class TransparencyContents extends FingerprintTransparency {
        @Override
        protected void capture(String keyword, Map<String, Supplier<byte[]>> data) {
            for (String suffix : data.keySet()) {
                byte[] content = data.get(suffix).get();
                // System.out.printf("%,9d B %-6s %s\n", content.length, suffix, keyword);
                if (suffix.equals(".json") && keyword.equals("shuffled-minutiae")) {
                    System.out.println(keyword);
                    System.out.println(suffix);
                    System.out.println(content.length + "B");
                    System.out.println(content);        
                }
            }
        }
    }

Error on caching Fingerprint template

Hi!! I want to cache the fingerprint template by serializing it with:
` FingerprintTemplate probe = new FingerprintTemplate(
new FingerprintImage()
.dpi(500)
.decode(Files.readAllBytes(Paths.get("src/image/101_1.tif"))));

    byte [] template=probe.toByteArray();`

But following errors appears:
Exception in thread "main" java.lang.ExceptionInInitializerError at JsonTemplate.<init>(JsonTemplate.java:15) at FingerprintTemplate.toByteArray(FingerprintTemplate.java:264) at MainClass.main(MainClass.java:14) Caused by: java.lang.NullPointerException at java.base/java.io.Reader.<init>(Reader.java:167) at java.base/java.io.InputStreamReader.<init>(InputStreamReader.java:113) at org.apache.commons.io.IOUtils.copy(IOUtils.java:2440) at org.apache.commons.io.IOUtils.toString(IOUtils.java:1084) at FingerprintCompatibility.lambda$static$0(FingerprintCompatibility.java:37) at com.machinezoo.noexception.CheckedExceptionHandler.run(CheckedExceptionHandler.java:1408) at FingerprintCompatibility.<clinit>(FingerprintCompatibility.java:35) ... 3 more

The code in MainClass line 14 is:
byte [] template=probe.toByteArray();

About rotation invariance

Hello Robert, I see you specify that "SourceAFIS is a rotation-invariant and translation-invariant algorithm.". However I am capturing a probe then trying to identify to the same finger with slight rotations (like ~20 degrees) and the score goes below threashold. Is there an option to activate the invariance for rotation and translation ? Testing on 3.8.1 Java version.

java.lang.VerifyError: com/machinezoo/sourceafis/TemplateBuilder

Here is my stacktrace

12-17 16:16:47.548 4857-4857/com.fgtit.fingermap E/dalvikvm: Could not find class 'com.machinezoo.sourceafis.-$$Lambda$FingerprintTransparency$bxEfwQYwk7xURQd0FvRXP0V_KSg', referenced from method com.machinezoo.sourceafis.FingerprintTransparency.json
12-17 16:16:47.554 4857-4857/com.fgtit.fingermap E/dalvikvm: Could not find class 'com.machinezoo.sourceafis.-$$Lambda$Ybta_3GA0aExx2iuGeU-MoqWUyc', referenced from method com.machinezoo.sourceafis.FingerprintTransparency.logBooleanMap
12-17 16:16:47.555 4857-4857/com.fgtit.fingermap E/dalvikvm: Could not find class 'com.machinezoo.sourceafis.-$$Lambda$vTn_9J5XoH3lgRilx-n-zhp0WDo', referenced from method com.machinezoo.sourceafis.FingerprintTransparency.logDoubleMap
12-17 16:16:47.557 4857-4857/com.fgtit.fingermap E/dalvikvm: Could not find class 'com.machinezoo.sourceafis.-$$Lambda$O3nxvKO69gAbI9j-1qVeVoGSTFE', referenced from method com.machinezoo.sourceafis.FingerprintTransparency.logHistogram
12-17 16:16:47.558 4857-4857/com.fgtit.fingermap E/dalvikvm: Could not find class 'com.machinezoo.sourceafis.-$$Lambda$FingerprintTransparency$Nfc7TLQ3rE6aLE0vpb4VJPfFdZA', referenced from method com.machinezoo.sourceafis.FingerprintTransparency.logMinutiae
12-17 16:16:47.560 4857-4857/com.fgtit.fingermap E/dalvikvm: Could not find class 'com.machinezoo.sourceafis.-$$Lambda$1mpxgaVXJYYhua_urH6RebY05Is', referenced from method com.machinezoo.sourceafis.FingerprintTransparency.logPointMap
12-17 16:16:47.563 4857-4857/com.fgtit.fingermap E/dalvikvm: Could not find class 'com.machinezoo.sourceafis.-$$Lambda$FingerprintTransparency$FcZVeRGwvHWAwjyBWdB2jEErK4I', referenced from method com.machinezoo.sourceafis.FingerprintTransparency.logSkeleton
12-17 16:16:47.564 4857-4857/com.fgtit.fingermap E/dalvikvm: Could not find class 'com.machinezoo.sourceafis.-$$Lambda$FingerprintTransparency$zY92akZXEZd0jUjbyt17TSukveM', referenced from method com.machinezoo.sourceafis.FingerprintTransparency.logBestMatch
12-17 16:16:47.565 4857-4857/com.fgtit.fingermap E/dalvikvm: Could not find class 'com.machinezoo.sourceafis.-$$Lambda$FingerprintTransparency$KJ-QQXxBTwSUtCLLvWd4FO4s900', referenced from method com.machinezoo.sourceafis.FingerprintTransparency.logBlockMap
12-17 16:16:47.566 4857-4857/com.fgtit.fingermap E/dalvikvm: Could not find class 'com.machinezoo.sourceafis.-$$Lambda$FingerprintTransparency$YNHJ3S8uPX-COtLfSiWzc_DH_HI', referenced from method com.machinezoo.sourceafis.FingerprintTransparency.logEdgeHash
12-17 16:16:47.568 4857-4857/com.fgtit.fingermap E/dalvikvm: Could not find class 'com.machinezoo.sourceafis.-$$Lambda$FingerprintTransparency$m189AtGZxTeszYUZH1Ar3At_Gew', referenced from method com.machinezoo.sourceafis.FingerprintTransparency.logEdgeTable
12-17 16:16:47.569 4857-4857/com.fgtit.fingermap E/dalvikvm: Could not find class 'com.machinezoo.sourceafis.-$$Lambda$FingerprintTransparency$ePYS0vZ4s7XzYQ2G2QPaX-F2B5I', referenced from method com.machinezoo.sourceafis.FingerprintTransparency.logIsoMetadata
12-17 16:16:47.570 4857-4857/com.fgtit.fingermap E/dalvikvm: Could not find class 'com.machinezoo.sourceafis.-$$Lambda$FingerprintTransparency$8sgZdxSLzU0buCiYxt5fOlePWNk', referenced from method com.machinezoo.sourceafis.FingerprintTransparency.logPairing
12-17 16:16:47.571 4857-4857/com.fgtit.fingermap E/dalvikvm: Could not find class 'com.machinezoo.sourceafis.-$$Lambda$FingerprintTransparency$8DXMiwcgakNE2z6D9vhj4ehnDk8', referenced from method com.machinezoo.sourceafis.FingerprintTransparency.logRootPairs
12-17 16:16:47.572 4857-4857/com.fgtit.fingermap E/dalvikvm: Could not find class 'com.machinezoo.sourceafis.-$$Lambda$FingerprintTransparency$PpB6BUgvDKB7adncP36O5kom69M', referenced from method com.machinezoo.sourceafis.FingerprintTransparency.logScore
12-17 16:16:47.595 4857-4857/com.fgtit.fingermap E/dalvikvm: Could not find class 'java.util.function.Function[]', referenced from method com.machinezoo.sourceafis.TemplateBuilder.decodeImage
12-17 16:16:47.595 4857-4857/com.fgtit.fingermap E/dalvikvm: Could not find class 'com.machinezoo.sourceafis.-$$Lambda$TemplateBuilder$Dv2GmpbkbkWYmWfhRICjnadOihE', referenced from method com.machinezoo.sourceafis.TemplateBuilder.decodeSafely
12-17 16:16:47.602 4857-4857/com.fgtit.fingermap E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.fgtit.fingermap, PID: 4857
java.lang.VerifyError: com/machinezoo/sourceafis/TemplateBuilder
at com.machinezoo.sourceafis.FingerprintTemplate.create(FingerprintTemplate.java:95)

Can you give a help please?

ISO_19794_2_2005 support

import a initial ISO_19794_2_2005 format .dat file and covert to FingerprintTemplate, then export it by ISO_19794_2_2005 format.
However matchs both initial and final .dat and there is no match.

Getting Unsupported image format while passing byte array to FingerprintTemplate

I have trying to pass byte array to FingerprintTemplate

public Boolean compareFingerPrint() throws IOException {
String encoded_string = "Wn8OG3B4lIoFT5y+vc8FGsezEmrKPDQVZgtkZFs0emNKtLkQiOsoXE5xGsEJ9hnUk129j7Jgg4uWlMXvAn+f0y0owwuRGyvkp+EomVvdmWgZ2iiHXMwyEi3AtCwnSrryP7eCAHRJQRiEXXBS757qbgftJ0Etd1tBGi1yh/cdpVwbLcnrrw1fYCpk/0fwbPl8Gy3J668NX2AqZP9H8Gz5fBstyeuvDV9gKmT/R/Bs+XwbLcnrrw1fYCpk/0fwbPl8Gy3J668NX2AqZP9H8Gz5fBstyeuvDV9gKmT/R/Bs+XwbLcnrrw1fYCpk/0fwbPl8Gy3J668NX2AqZP9H8Gz5fBstyeuvDV9gKmT/R/Bs+XwbLcnrrw1fYCpk/0fwbPl8Gy3J668NX2AqZP9H8Gz5fBstyeuvDV9gKmT/R/Bs+XwbLcnrrw1fYCpk/0fwbPl8Gy3J668NX2AqZP9H8Gz5fBstyeuvDV9gKmT/R/Bs+XwbLcnrrw1fYCpk/0fwbPl8Gy3J668NX2AqZP9H8Gz5fA==";

	double threshold = 40;
	boolean matches;

// byte[] probeImage = Files.readAllBytes(Paths.get("/tmp/left_index/demo1.png"));
// byte[] candidateImage = Files.readAllBytes(Paths.get("/tmp/left_index/demo1.png"));

	byte[] probeImage = Base64.decodeBase64(encoded_string.getBytes());
	byte[] candidateImage = Base64.decodeBase64(encoded_string.getBytes());
	
	System.out.println("Probe Image : " + Arrays.toString(probeImage));

	FingerprintTemplate probe = new FingerprintTemplate(
	    new FingerprintImage()
	        .dpi(500)
	        .decode(probeImage));

	FingerprintTemplate candidate = new FingerprintTemplate(
	    new FingerprintImage().dpi(500)
	        .decode(candidateImage));
	
	double score = new FingerprintMatcher()
		    .index(probe)
		    .match(candidate);
	
	System.out.println("Score : " + score);
	
	if(score >= threshold)
		matches = true;
	else 
		matches = false;
	
	return matches;
}

Android API 19 not supported

Please help, I am using an android KitKat (API 19) biometric device with sourceafis, but I keep getting errors. I later learnt that in require min-api 24. Please how can I use sourceafis with API 19.

I can't turn off the fingerprintreader

I have button with onclick, so it trigger the fingerprint scan and it work
basically like
btncheck.setOnClickListener(new View.OnClickListener() {
if(CheckExistEmployee())
{
fingerprint = new Fingerprint();
fingerprint.scan(AttendanceSaveActivity.this, printHandler, null);
}
} );

but i try to turnoff the reader when the activity closed so i put fingerprint.turnOffReader() in onDestroy Function. But its not work

@OverRide
public void onDestroy()
{
fingerprint.turnOffReader();
super.onDestroy()
}

did i do something wrong in this ?

erro toByteArray()

Hey how's it going?
I'm migrating from 3.4 to 3.11
And it's giving an error right here:

------------>> byte[] serialized = template.toByteArray(); <<---

CODE:

byte[] image = Files.readAllBytes(Paths.get("fingerprint.jpeg"));
FingerprintTemplate template = new FingerprintTemplate(
new FingerprintImage()
.dpi(500)
.decode(image));

byte[] serialized = template.toByteArray();

You know what it can be?

ERRRO:

mar 07, 2021 11:21:48 PM com.sun.jersey.spi.container.ContainerResponse mapMappableContainerException
SEVERE: The exception contained within MappableContainerException could not be mapped to a response, re-throwing to the HTTP container
java.lang.NoClassDefFoundError: org/apache/commons/io/IOUtils
at com.machinezoo.sourceafis.PlatformCheck.lambda$resource$1(PlatformCheck.java:54)
at com.machinezoo.noexception.CheckedExceptionHandler.get(CheckedExceptionHandler.java:1738)
at com.machinezoo.sourceafis.PlatformCheck.resource(PlatformCheck.java:50)
at com.machinezoo.sourceafis.FingerprintCompatibility.(FingerprintCompatibility.java:37)
at com.machinezoo.sourceafis.PersistentTemplate.(PersistentTemplate.java:17)
at com.machinezoo.sourceafis.FingerprintTemplate.serialize(FingerprintTemplate.java:300)
at br.com.restful.dao.HashDAO.retornaTemplateJson(HashDAO.java:448)
at br.com.restful.controller.ClienteController.retornaTemplateCliente(ClienteController.java:91)
at br.com.restful.resource.ClienteResource.retornaTemplateClienteJson(ClienteResource.java:170)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:860)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
at com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:209)
at com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:244)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1629)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:61)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:530)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:347)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:256)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:382)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:626)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.io.IOUtils
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:565)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 63 more

2021-03-07 23:21:48.399:WARN:oejs.HttpChannel:qtp193064360-12: /cliente/retornaTemplate
javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/apache/commons/io/IOUtils
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:420)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:860)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
at com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:209)
at com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:244)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1629)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:61)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:530)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:347)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:256)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:382)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:626)
at java.lang.Thread.run(Thread.java:748)
Caused by:
java.lang.NoClassDefFoundError: org/apache/commons/io/IOUtils
at com.machinezoo.sourceafis.PlatformCheck.lambda$resource$1(PlatformCheck.java:54)
at com.machinezoo.noexception.CheckedExceptionHandler.get(CheckedExceptionHandler.java:1738)
at com.machinezoo.sourceafis.PlatformCheck.resource(PlatformCheck.java:50)
at com.machinezoo.sourceafis.FingerprintCompatibility.(FingerprintCompatibility.java:37)
at com.machinezoo.sourceafis.PersistentTemplate.(PersistentTemplate.java:17)
at com.machinezoo.sourceafis.FingerprintTemplate.serialize(FingerprintTemplate.java:300)
at br.com.restful.dao.HashDAO.retornaTemplateJson(HashDAO.java:448)
at br.com.restful.controller.ClienteController.retornaTemplateCliente(ClienteController.java:91)
at br.com.restful.resource.ClienteResource.retornaTemplateClienteJson(ClienteResource.java:170)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:860)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
at com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:209)
at com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:244)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1629)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:61)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:530)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:347)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:256)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:382)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:626)
at java.lang.Thread.run(Thread.java:748)
Caused by:
java.lang.ClassNotFoundException: org.apache.commons.io.IOUtils
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:565)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.machinezoo.sourceafis.PlatformCheck.lambda$resource$1(PlatformCheck.java:54)
at com.machinezoo.noexception.CheckedExceptionHandler.get(CheckedExceptionHandler.java:1738)
at com.machinezoo.sourceafis.PlatformCheck.resource(PlatformCheck.java:50)
at com.machinezoo.sourceafis.FingerprintCompatibility.(FingerprintCompatibility.java:37)
at com.machinezoo.sourceafis.PersistentTemplate.(PersistentTemplate.java:17)
at com.machinezoo.sourceafis.FingerprintTemplate.serialize(FingerprintTemplate.java:300)
at br.com.restful.dao.HashDAO.retornaTemplateJson(HashDAO.java:448)
at br.com.restful.controller.ClienteController.retornaTemplateCliente(ClienteController.java:91)
at br.com.restful.resource.ClienteResource.retornaTemplateClienteJson(ClienteResource.java:170)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:860)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
at com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:209)
at com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:244)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1629)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:61)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:530)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:347)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:256)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:382)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:626)
at java.lang.Thread.run(Thread.java:748)

Exception ImageReadException

i am using netbeans and buil , run operations are successful but
I am getting following error while running jar file

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/sanselan/ImageReadException
	at com.machinezoo.sourceafis.FingerprintTemplate.create(FingerprintTemplate.java:96)
	at com.machinezoo.sourceafis.MainClass.main(MainClass.java:47)
Caused by: java.lang.ClassNotFoundException: org.apache.sanselan.ImageReadException
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 2 more

My main class

package com.machinezoo.sourceafis;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;

public class MainClass {

    public static final String ANSI_RESET = "\u001B[0m";
    public static final String ANSI_BLACK = "\u001B[30m";
    public static final String ANSI_RED = "\u001B[31m";
    public static final String ANSI_GREEN = "\u001B[32m";
    public static final String ANSI_YELLOW = "\u001B[33m";
    public static final String ANSI_BLUE = "\u001B[34m";
    public static final String ANSI_PURPLE = "\u001B[35m";
    public static final String ANSI_CYAN = "\u001B[36m";
    public static final String ANSI_WHITE = "\u001B[37m";

    public static void main(String[] args) {
        try {
            String probPath = "/var/www/java/robertvazan-sourceafis-java-6db53f9947c0/resources/prob.tif";
            String candidatePath = "/var/www/java/robertvazan-sourceafis-java-6db53f9947c0/resources/101_7.tif";
            System.out.printf("The culprit: ");
            byte[] probeImage = Files.readAllBytes(Paths.get(probPath));
            byte[] candidateImage = Files.readAllBytes(Paths.get(candidatePath));
            File folder = new File("resources");
            File[] listOfFiles = folder.listFiles();

            for (int i = 0; i < listOfFiles.length; i++) {
              if (listOfFiles[i].isFile()) {
                System.out.println("File " + listOfFiles[i].getName());
              } else if (listOfFiles[i].isDirectory()) {
                System.out.println("Directory " + listOfFiles[i].getName());
              }
            }
            FingerprintTemplate probe = new FingerprintTemplate().dpi(500).create(probeImage);
            List<UserDetails> candidates = new ArrayList<>();
            UserDetails candidate = new UserDetails();
            candidate.id = 1;
            candidate.name = "XYZ";
            candidate.template = new FingerprintTemplate().dpi(500).create(candidateImage);
            candidates.add(candidate);
            UserDetails culprit = candidate.find(probe, candidates);
            if (culprit == null) {
                System.out.printf("unable to find match");
            } else {
                System.out.printf("The culprit: " + ANSI_RED + "%s", culprit.name);
            }
        

        } catch (IOException e) {
//            e.printStackTrace();
            System.out.printf("Exception occurred");
        }
    }
}

class UserDetails {

    int id;
    String name;
    FingerprintTemplate template;

    UserDetails find(FingerprintTemplate probe, Iterable<UserDetails> candidates) {
        FingerprintMatcher matcher = new FingerprintMatcher()
                .index(probe);
        UserDetails match = null;
        double high = 0;
        for (UserDetails candidate : candidates) {
            double score = matcher.match(candidate.template);
            if (score > high) {
                high = score;
                match = candidate;
            }
        }
        double threshold = 40;
        return high >= threshold ? match : null;
    }
}

Am GEtting my image from a url how possible to match??

hello please am getting my image from a url how possible to match??

url="myapi/biometrics/" + biometerics + ".JPEG";
Bitmap bitmap = Glide
.with(FtrScanDemoUsbHostActivity.this)
.asBitmap()
.load(url)
.diskCacheStrategy(DiskCacheStrategy.NONE)
.skipMemoryCache(true)
.centerCrop()
.submit()
.get();
ByteArrayOutputStream stream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, stream);
byte[] byteArray = stream.toByteArray();
FingerprintTemplate probe = new FingerprintTemplate().dpi(500).create(byteArray);

File extStorageDirectory = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
mDir = new File(extStorageDirectory,"Mypath/Biometrics/"+mybiometrics+".JPEG");
Bitmap myBitmap = BitmapFactory.decodeFile(mDir.getAbsolutePath());
ByteArrayOutputStream stream2 = new ByteArrayOutputStream();
myBitmap.compress(Bitmap.CompressFormat.JPEG, 100, stream2);
byte[] byteArray2 = stream2.toByteArray();

				FingerprintTemplate candidate = new FingerprintTemplate().dpi(500).create(byteArray2);
				 score = new FingerprintMatcher(probe)
						.match(candidate);

but when i want to compile my apk i get a warning of this

com.android.tools.r8.internal.YI0: One or more instruction is preventing default interface method from being desugared: java.lang.Double it.unimi.dsi.fastutil.objects.Reference2DoubleMap.getOrDefault(java.lang.Object, java.lang.Double)

can anyone help with a better way of doing this using the New Api Method Call Points that is

FingerprintTemplate probe = new FingerprintTemplate(
new FingerprintImage(
Files.readAllBytes(Paths.get("probe.png")),
new FingerprintImageOptions()
.dpi(500)));

				FingerprintTemplate candidate = new FingerprintTemplate(
						new FingerprintImage(
								Files.readAllBytes(Paths.get("candidate.png")),
								new FingerprintImageOptions()
										.dpi(500)));

Camera input

Hi,

I am trying to build an optical fingerprint sensor with this library. The idea is to have a camera take pictures of a finger through a window and match them with older pictures. To the eye, the quality of the images looks pretty decent.
The template I get has about 100 edges and minutiae. When matching with the exact same image, I get a very big score, however, even the slightest change (for example take the same image, but a slightly different part of it) results in a score of 0.

Also I need to do some preprocessing with opencv to be able to parse any edges from the image.

Any idea what's going wrong? How "change-resistent" is this library intended to be? Should a slight movement or rotation of the image be tolerated?
And another thing: Do you have any tips on how to preprocess images to get better results with an optical camera?

Here you can find the source code:
https://github.com/peteole/smartWindowJava

Thanks in advance!

very long response time

Hello, how are you?
I have a problem with version 3.13...
I think I might be doing something wrong... so I wanted your help if possible.

I'm facing a response time issue on this line, it takes a long time...

  • double score = new FingerprintMatcher(probe).match(candidate);

EX CODE :

double high = 0;
double threshold = 40;
Integer match = null;

          pstmt = conexao.prepareStatement("SELECT d.pessoa_id, d.FingerprintTemplate \n" + 
          "FROM pessoa as p \n" + 
          "inner JOIN digital as d on p.id = d.pessoa_id \n" + 
          "where p.tipo_pessoa_id in ("+ tipoPessoa +") " +
          "and FingerprintTemplate <> '' \n" + 
          "and p.libera_visitante <> 'bloqueado' "
          );
rs = pstmt.executeQuery();

//  (2500 FingerprintTemplate)
while (rs.next()) {
        byte[] serialized = rs.getBytes("FingerprintTemplate");
        FingerprintTemplate candidate = new FingerprintTemplate(serialized);

        // ******************* it's slow here
        double score = new FingerprintMatcher(probe).match(candidate);
        
        if (score > high) {
          high = score;
          match = rs.getInt("pessoa_id");
        }
}`

The templates are in a table. In previous versions I kept the template serialized, but I saw that it is already deprecated.
Now I store the template in a blob field.

Am I doing this right?

thanks

Template fusion

Is there a way to create a template for matching from multiple input images? And would that even make a difference? I have often seen in commercial packages a way of combining templates from multiple images (of the same finger) when "enrolling" a fingerprint, in order to create an enhanced template with good data, for matching. Would that be possible with SourceAFIS? Or even desirable?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.