public class FingerprintTemplate extends Object
Fingerprint image can be converted to template by calling create(byte[])
method
on an empty fingerprint template instantiated with FingerprintTemplate()
constructor.
Image DPI may be specified first by calling dpi(double)
.
Since image processing is expensive, applications should cache serialized templates.
Serialization into JSON format is performed by serialize()
method.
JSON template can be deserialized by calling deserialize(String)
.
on an empty fingerprint template instantiated with FingerprintTemplate()
constructor.
Matching is performed by constructing FingerprintMatcher
,
passing probe fingerprint to its FingerprintMatcher.index(FingerprintTemplate)
method,
and then passing candidate fingerprints to its FingerprintMatcher.match(FingerprintTemplate)
method.
FingerprintTemplate
contains two kinds of data: fingerprint features and search data structures.
Search data structures speed up matching at the cost of some RAM.
Only fingerprint features are serialized. Search data structures are recomputed after every deserialization.
FingerprintMatcher
Constructor and Description |
---|
FingerprintTemplate()
Instantiate an empty fingerprint template.
|
Modifier and Type | Method and Description |
---|---|
FingerprintTemplate |
convert(byte[] iso)
Import ISO 19794-2 fingerprint template from another fingerprint recognition system.
|
FingerprintTemplate |
create(byte[] image)
Create fingerprint template from fingerprint image.
|
FingerprintTemplate |
deserialize(String json)
Deserialize fingerprint template from JSON string.
|
FingerprintTemplate |
dpi(double dpi)
Set DPI (dots per inch) of the fingerprint image.
|
String |
serialize()
Serialize fingerprint template to JSON string.
|
FingerprintTemplate |
transparency(FingerprintTransparency transparency)
Enable algorithm transparency.
|
public FingerprintTemplate()
create(byte[])
, deserialize(String)
, or convert(byte[])
to actually fill the template with useful biometric data.public FingerprintTemplate transparency(FingerprintTransparency transparency)
FingerprintTransparency
instance.transparency
- target FingerprintTransparency
or null
to disable algorithm transparencythis
(fluent method)FingerprintTransparency
public FingerprintTemplate dpi(double dpi)
create(byte[])
.
Check your fingerprint reader specification for correct DPI value. Default DPI is 500.dpi
- DPI of the fingerprint image, usually around 500this
(fluent method)create(byte[])
public FingerprintTemplate create(byte[] image)
dpi(double)
.
All image formats supported by Java's ImageIO
are accepted, for example JPEG, PNG, or BMP,
This method replaces any previously added biometric data in this template.
image
- fingerprint image in ImageIO
-supported formatthis
(fluent method)dpi(double)
public FingerprintTemplate deserialize(String json)
serialize()
to reconstruct an exact copy of the original fingerprint template.
Templates produced by previous versions of SourceAFIS may fail to deserialize correctly. Applications should re-extract all templates from original raw images when upgrading SourceAFIS.
This method replaces any previously added biometric data in this template.
json
- serialized fingerprint template in JSON format produced by serialize()
this
(fluent method)serialize()
,
Template formatpublic String serialize()
deserialize(String)
.
Persisting templates alongside fingerprint images allows applications to start faster,
because template deserialization is more than 100x faster than re-extraction from fingerprint image.
Serialized template excludes search structures that FingerprintTemplate
keeps to speed up matching.
Serialized template is therefore much smaller than in-memory FingerprintTemplate
.
Serialization format can change with every SourceAFIS version. There is no backward compatibility of templates. Applications should preserve raw fingerprint images, so that templates can be re-extracted after SourceAFIS upgrade. Template format for current version of SourceAFIS is documented on SourceAFIS website.
deserialize(String)
,
Template formatpublic FingerprintTemplate convert(byte[] iso)
This method replaces any previously added biometric data in this template.
This method is written for ISO 19794-2:2005, but it should be able to handle ISO 19794-2:2011 templates. If you believe you have a conforming template, but this method doesn't accept it, mail the template in for analysis. No other fingerprint template formats are currently supported.
Note that the use of ISO 19794-2 templates is strongly discouraged and support for the format might be removed in future releases. This is because ISO is very unfriendly to opensource developers, Its "standards" are only available for a high fee and with no redistribution rights. There is only one truly open and widely used fingerprint exchange format: fingerprint images. Application developers are encouraged to collect, store, and transfer fingerprints as images. Besides compatibility and simplicity this brings, use of images allows SourceAFIS to co-tune its feature extractor and matcher for higher accuracy.
iso
- ISO 19794-2 template to importthis
(fluent method)create(byte[])
,
deserialize(String)
,
serialize()
Copyright © 2018. All rights reserved.