The basics of fingerprint SDK
We receive many basic doubts concerning the use of fingerprint SDK 2007. In this tutorial , the most common doubts are lighted and basic explanations are given.
Events
In computer programming , an event is an action that can be detected, and the programmer might want to handle it, like a mouse click or a message from a sensor.
The fingerprints readers generate some events, and the SDK offer simple ways of treating them. Let's take a look at some events:
* SensorPlug: is fired whenever a fingerprint reader is plugged into the computer, it is a good idea to initialize the capture when the event is fired(see the section "First comes First").
* SensorUnplug: is fired whenever a fingerprint reader is unplugged from the computer, analogal to the plug, it is a good idea to stop the capture when the event is fired (see the section "Destroying is important").
* ImageAcquired: is fired whenever a fingerprint image is acquired from a plugged fingerprint reader. A very important event, it receives the fingerprint image, allowing it to be shown on the screen or have the template extracted.
First comes first
Maybe the most common mistake customers make. Some functions must execute once, so others functions work properly. To execute those functions, it is necessary to initialize the GrFinger and the capture. A suggestion is initialize the capture on the SensorPlug event, and initialize the GrFinger on the moment the program opens.
Doing what has to be done
Ok, you know the events, you know how to iniatilize everything, but how to compare your beautiful fingerprints, that's what we are going to show here.
The extraction
Another important concept, the image you get on the event "ImageAcquired" is nothing, i mean, the image itself is nothing, comparisons can't be made over a simple image, but there are good news: The "extraction" method.
The extraction method is the responsible for doing the magic of converting a simple and unuseful image, into a pretty shiny file called template.
Technically it is mathematical representation of the fingerprint, and can be used for comparisons.
Comparing the fingerprints
Once you get to this point you have two directions to go:
Verify
The function verify performs a verification by comparing the two templates supplied, you want to use this function when you know what templates should be compared, but don't use it when you want to search a full database for example.
Identify
Sometimes you want to loop some fingerprints to find one specif fingerprint. In those cases verify is not a good option, this is why identify exists.
This function requires a function to be called before it, it is the IdentifyPrepare method, this method will prepare the fingerprint you want to find, in a way that will make the comparisons smoothier. It is very important, cause identification is a linear search algorithm , and as we know, it demands lots of processing. Please leave IdentifyPrepare outside the loop , or the idea of making things faster will be blown up.
The importance of destroying
Except for some luck guys who develop under platforms who have garbage collector, it is necessary to pay attention to the use of memory.
All the functions describe here, consume some memory. Today's computer still are not smart enough to fully understand when something is no longer necessary, for this reason clear the objects in the end of the program (or in a moment you judge appropriate).
And of course, remember stopping capture with the function CapFinalize, some readers have a red light turned on when the capture is initialized, if you finalize it correctly the light shoud turn off.