3

I am saving the fingerprints in a field "blob", then wonder if the only way to compare these impressions is retrieving all prints saved in the database and then create a vector to check, using the function "identify_finger"? You can check directly from the database using a SELECT?

I'm working with libfprint. In this code the verification is done in a vector:

def test_identify():
    cur = DB.cursor()
    cur.execute('select id, fp from print')
    id = []
    gallary = []
    for row in cur.fetchall():
        data = pyfprint.pyf.fp_print_data_from_data(str(row['fp']))
        gallary.append(pyfprint.Fprint(data_ptr = data))
        id.append(row['id'])
    n, fp, img = FingerDevice.identify_finger(gallary)
Ivanelson
  • 97
  • 1
  • 10
  • instead of blob, I would think features of print should be stored in the table, so that you can wrote queries to match those features in the record not retrieving them line by line. – zinking Jul 10 '12 at 06:38
  • zinking, You can post an example? I want to check if it is digital under the fingerprint already exists in the database (select). I am passing the array vector to the function (libfprint.identify_finger) and when the table is large will slow down the scan. – Ivanelson Jul 10 '12 at 07:54

3 Answers3

2

There are two fundamentally different ways to use a fingerprint database. One is to verify the identity of a person who is known through other means, and one is to search for a person whose identity is unknown.

A simple library such as libfprint is suitable for the first case only. Since you're using it to verify someone you can use their identity to look up a single row from the database. Perhaps you've scanned more than one finger, or perhaps you've stored multiple scans per finger, but it will still be a small number of database blobs returned.

A fingerprint search algorithm must be designed from the ground up to narrow the search space, to compare quickly, and to rank the results and deal with false positives. Just as a Google search may come up with pages totally unrelated to what you're looking for, so too will a fingerprint search. There are companies that devote their entire existence to solving this problem.

Mark Ransom
  • 299,747
  • 42
  • 398
  • 622
1

Another way would be to have a mysql plugin that knows how to work with fingerprint images and select based on what you are looking for.

I really doubt that there is such a thing.

You could also try to parallelize the fingerprint comparation, ie - calling:

FingerDevice.identify_finger(gallary)

in parallel, on different cores/machines

Tudor Constantin
  • 26,330
  • 7
  • 49
  • 72
  • 1
    So I'm doing well and in time the search will lose performance, I am always creating a vector with all digital database. – Ivanelson Jul 10 '12 at 07:43
  • Wrapper of libfprint: [pyfprint in github](https://github.com/luksan/pyfprint/blob/master/pyfprint/pyfprint.py) – Ivanelson Jul 10 '12 at 07:57
0

You can't check directly from the database using a SELECT because each scan is different and will produce different blobs. libfprint does the hard work of comparing different scans and judging if they are from the same person or not

What zinking and Tudor are saying, I think, is that if you understand how does that judgement process works (which is by the way, by minutiae comparison) you can develop a method of storing the relevant data for the process (the *minutiae, maybe?) in the database and then a method for fetching the relevant values -- maybe a kind of index or some type of extension to the database.

In other words, you would have to reimplement the libfprint algorithms in a more complex (and beautiful) way, instead of just accepting the libfprint method of comparing the scan with all stored fingerprint in a loop.

other solutions for speeding your program

use C:

I only know sufficient C to write kind of hello-world programs, but it was not hard to write code in pure C to use the fp_identify_finger_img function of libfprint and I can tell you it is much faster than pyfprint.identify_finger.

You can continue doing the enrollment part of the stuff in python. I do it.

use a time / location based SELECT:

If you know your users will scan their fingerprints with more probability at some time than other time, or at some place than other place (maybe arriving at work at some time and scanning their fingers, or leaving, or entering the building by one gate, or by other), you can collect data (at each scan) for measuring the probabilities and creating parallel tables to sort the users for their probability of arriving at each time and location.

We know that identify_finger tries to identify fingers in a loop with the fingerprint objects you provided in a list, so we can use that and give it the objects sorted in a way in which the more likely user for that time and that location will be the first in the list and so on.

Community
  • 1
  • 1
fiatjaf
  • 11,479
  • 5
  • 56
  • 72