Menu

Unsupported image format

mkw
2018-08-30
2020-06-10
  • mkw

    mkw - 2018-08-30

    Hi, Robert, thank you for providing this wonder application!

    I have just found sourceAFIS and worked on it for a few hours. On the first try-run, I encounter the error in the following (I copyed the first piece of your code from the "SourceAFIS for Java" page, and tried to read two tif images from the sample database you mentioned ) :

    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)
    at test.test.test.test.App.main(App.java:23)

    I will for sure continue exploring myself, but I will highly appreciate it if you can give me a little hint on where I should go :)

     
  • Robert Važan

    Robert Važan - 2018-08-30

    TIFF images are not supported by default in Java. You have to find some TIFF decoding library for java or use an external tool to convert the images to a more common format, for example PNG or JPEG.

     
  • mkw

    mkw - 2018-08-31

    I opened in an picture editor and save as jpeg, all works well. Thank you very much!

     
  • Robert Važan

    Robert Važan - 2018-09-14

    Latest SourceAFIS for Java now supports TIFF images.

     
  • Razmerita Andrei

    Hi Robert, I'm trying to user your project SourceAFIS in my android app, but I can't get the this object to read my image that is coming in array of bytes from Digital persona u4500. Looks like you dont yuse readAllBytes in the android version. And my digital persona array template is not accepted by your project.

    FingerprintTemplate probe = new FingerprintTemplate(~~~
    
    new FingerprintImage().dpi(500).
    decode(Files.readAllBytes("MyByteArrayp[]))));
    
    >                     Then I tried this and still doesn't work:
    
            boolean matches = false;
            double score = 0;
            byte[] fProbe = Arrays.copyOf(fingerPrintProbe, fingerPrintProbe.length);
            byte[] fCanditate = Arrays.copyOf(fingerPrintDb, fingerPrintDb.length);
            try {
                FingerprintTemplate probe = FingerprintCompatibility.convert(fProbe);
    
    
                FingerprintTemplate candidate = FingerprintCompatibility.convert(fCanditate);
                score = new FingerprintMatcher()
                        .index(probe)
                        .match(candidate);
                matches = score >= 40;
    
            } catch (Exception e) {
                e.printStackTrace();
            }
            return score;
        }
    

    I am using fingerprint Digital persona U4500, all it does with my sdk is scanning fingerprint and returning byte[] array and is easy to convert it to bitmap object. using:
    implementation 'asia.kanopi.tools:fingerscan:0.1'
    Any suggestion pls?

     

    Last edit: Razmerita Andrei 2020-06-10

Log in to post a comment.