Greetings Daniweb!

Just recently, I was able to integrate a Fingerprint device to my application. Can now scan fingerprints and save them to database using the INSERT TO syntax.

But I can't get my application to match scanned fingerprint to one already stored in the database, so that I could use fingerprint verification instead of the traditional ID Searching.
How it now works:
- After scanning the the fingerprint, the image is stored as fp_image of type byte()
- a normal INSERT TO code inserts the fp_image to the mysql table.
- in the mysql table, the image is stored in column 'fin_pr' of data type LONGBLOB.

What I tried:

  • Since a normal INSERT TO did the saving to the database, I assumed that, after scanning the fingerprint from the user, I could then use the normal SELECT FROM syntax to compare the scanned fingerprint and match it to the one that is already in the table. So I did this code:

    SqlRetrieve = "SELECT * FROM demographic WHERE fin_pr = @finger"
    cmd.Parameters.AddWithValue("@finger", fp_image)
    cmd.Connection = con
    cmd.CommandText = SqlRetrieve

But this does not return any rows, (meaning like, the fingerprint is not found) while I know there is such a fingerprint in the table. Seems like I need to do more?

Can someone here please shed some light on this?

  • The device is Secugen's Hamster IV
  • I have their SDK and I'm using it.
  • I'm on VB.NET + mysql
  • I can save the fingerprint to the table, and I'm sure its there.

Thanks and long live Daniweb!

Is the data coming in exactly the same? I cant imagine that two finger print readings are completely identical.

I don't know enough about your device or their API (or, really, the whole physical security thing as a whole), but I assume that the proper mechanics of this would be scan->process->save and then scan->process->match where "process" is some sort of algorithm that finds matching unique indicators of finger prints. The actual image itself is fairly worthless, IMO, unless you want to scan the entire database every time someone scans, and then reprocess the image and compare it to the new sample (which seems obnoxiously slow... but hey, it might be a more secure route :-/ )

ryantroop, thanks for your response.
No, data coming in is never the same. My problem is when I want to search for a certain user in the database, and I want to now use fingerprint rather than traditional search by ID or username, I can't search by using the fingerprint scanned at the time of searching. I can save the fingerprint template to the database pretty well, but when I want to search for one particular template/person, the simple normal SELECT FROM WHERE fingerprint = @fingerprint (type byte) returns 0 rows while a fingerprint to match exist.
So, it appears to me as if I need something more than just a normal SELECT FROM statement if I want to match. It seems there is a special case with fingerprint templates??

There isn't a special case with fingerprint templates at all. As @ryantroop tried to explain you're trying to compare two images as exactly the same when they won't be.
This is a brief explanation of finger print scanning taken from the net:
"When a computer checks your fingerprints, there obviously isn't a little person with a magnifying glass sitting inside, comparing your fingerprints with all the hundreds or thousands stored in the database! So how can a computer compare prints? During enrollment or verification, each print is analyzed for very specific features called minutiae, where the lines in your fingerprint terminate or split in two. The computer measures the distances and angles between these features—a bit like drawing lines between them—and then uses an algorithm (mathematical process) to turn this information into a unique numeric code. Comparing fingerprints is then simply a matter of comparing their unique codes. If the codes match, the prints match, and the person gains access."

Taking an image of a finger print and hoping to get an exact match with a second image of the same finger print when they're both converted to bytes is hopelessly simplistic. Even the smallest change will cause the select to fail.
You need a better process for recording the fingerprints, like the one above.

@savedlema, I think I should share how this is usually done.

The usual: "I'm Joc James." A fingerprint is given and the ID is verified. This is very fast, and usually how it's done.

Your method is only done when you don't have the person there to make a claim who they are. It's slow. And only gets slower as the database grows.

I didn't broach the issue that you rarely store the fingerprint image since that's the stuff you get out of papers on the subject.

hericles, thank you very much. I was missing the point by assuming that the device will get the fingerprint image that is exaclty the same as the first recorded one. But I realize this is just not possible.

So please, what must I do to match a person fingerprint and give him access?


Thank you. What's the best way please?

A way to match fingerprints is already provided with the SDK, apparently...

"SecuGen SDKs make it quick and easy to integrate SecuGen fingerprint scanning, template generation (minutiae extraction), and template matching functions (both one-to-one and one-to-many) into almost any type of sotware application.", Source:

Does the documentation not include some example code?

commented: the SDK sample code do not talk about 1:M identification. +2

@savedlema I see LaxLoafer is pointing us back to the documentation. As you are designing your system I can't tell you what's best. I can however point out that most systems have you tell them "I'm Lex Maxx" and then verify. To go for fingerprint only is rarely done due to speed issues. You have to check your design specs to see which is required.


The SDK included some sample code. However, the codes can only match fingerprints in two created templates, that is, scan a fingerprint and create a 1st template, and then scan a fingerprint and create another 2nd template, and then match 1st and 2nd template. This is easy as it does not involve pulling anything from the database and you are only dealing with comparing a fingerprint against just ONE fingerprint, contrary to like comparing 1 fingerprint to 1000 fingerprints stored in a database.

Thank you.

Which of their SDKs are you using? Note that SecuSearch SDK Pro for Windows features 1:N matching.

commented: +1 matching. +8

As stated, no two fingerprint scans will generate the same data/image. Intelligent fp scanning tech identifies notable features in a print and develops a hash of that. When the same finger is scanned again, those features are extracted and used to create a hash. The fact is, that only the hash (a numeric value) is stored in the database. Lookups are very fast as you can easily index that data.

Raw image comparisons are notoriously difficult and most of the time some algorithm such as that mentioned above will be used to identify comparable images, such as photographs of peoples' faces. As mentioned by others, there are API's out there that have done this work already - it is not trivial and requires some major software and image analysis chops.