0

I have saved the fingerprint impression in sqlite database as bitmap . Can anybody please help me with source code or link of android code to compare two fingerprint impressions as bitmap . To match for equality.

I have tried with following code . But it matches with all the fingerprint impression stored in database.

public boolean compare(Bitmap imageToCompare , Bitmap imageInDb )
{
    System.out.println("Inside Compare");
    System.out.println("imageToCompare::::"+imageToCompare);
    System.out.println("imageInDb::::"+imageInDb);

    /*int width = imageToCompare.getWidth();
    System.out.println("width::::::"+width);
    int height = imageToCompare.getHeight();
    System.out.println("height::::"+height);
    int pixelCount = width * height;

    int width1 = imageInDb.getWidth();
    System.out.println("width1::::::"+width1);
    int height1 = imageInDb.getHeight();
    System.out.println("height1::::"+height1);*/
    int pixelCount = mImageWidth * mImageHeight;

    System.out.println("pixelCount::::"+pixelCount);
    int[] pixels1 = new int[pixelCount];
    int[] pixels2 = new int[pixelCount];
    System.out.println("11111111111111111");
    //imageToCompare.getPixels(pixels1, 0, 0, 0, width, height);
    imageToCompare.getPixels(pixels1, 0,mImageWidth, 0, 0, mImageWidth, mImageHeight);
    imageInDb.getPixels(pixels2, 0,mImageWidth, 0,0, mImageWidth, mImageHeight);
    System.out.println("22222222222222");
    for (int i = 0; i < pixelCount; i++) {
        if (pixels1[i] != pixels2[i]) {
            System.out.println("333333333333");
            return false;
        }
    }
    System.out.println("444444444444444444");
    return true;
}

thanks

Aleks G
  • 56,435
  • 29
  • 168
  • 265
user1294668
  • 163
  • 1
  • 3
  • 12
  • 1
    Comparing fingerprints is a lot more than just comparing two bitmaps. Each fingerprint is unique (ok, almost unique) based on specific points. Usually a minimum of 6 points is required to say that there's a match. Here is [one description of the matching process](http://fingerchip.pagesperso-orange.fr/biometrics/types/fingerprint_algo.htm). You can use OpenCV to do the actual matching, but it's not the easiest thing to do. – Aleks G Jul 10 '12 at 09:54

2 Answers2

0

You can not do the comparison like string comparison or pixel-wise comparison. It is possible, only if you have the same fingerprint image again and again. But in the reality, When you have the fingerprint two times, both the images will be different from each other with little bit position change, angle change, and quality of the scan. So String/pixel comparison is not possible.

All the scanners do provide the SDK for capturing the fingerprint and comparing them (1:1) which you can use for developing the desktop application. If you need to compare the scanned images at the server, then you need to implement your own Automatic Finger Identification algorithm or you have to use third party services such as

  1. CAMS
  2. M2Sys
  3. Neurotechnology
Ravanan
  • 536
  • 2
  • 13
-1

To compare two bitmaps you can use openCV library for android. There are many functions for image compering and this topic is wide and depends on percision that you need. You can start with cvNorm function.

In link below you will have openCV library and samples compiled under Java, so you don't have to write native code in C.

link

openCV website

Jakub Szczygieł
  • 1,203
  • 1
  • 13
  • 26