Class FingerprintTemplate

SourceAFIS » API Reference

  • public class FingerprintTemplate
    extends Object
    Biometric description of a fingerprint suitable for efficient matching. Fingerprint template holds high-level fingerprint features, specifically ridge endings and bifurcations (together called minutiae). Original image is not preserved in the fingerprint template and there is no way to reconstruct the original fingerprint from its template.
    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.
    See Also:
    SourceAFIS overview, FingerprintMatcher
    • Constructor Detail

      • FingerprintTemplate

        public FingerprintTemplate()
        Instantiate an empty fingerprint template. Empty template represents fingerprint with no features that does not match any other fingerprint (not even itself). You can then call create(byte[]) or deserialize(String) to actually fill the template with useful biometric data.
    • Method Detail

      • dpi

        public FingerprintTemplate dpi(double dpi)
        Set DPI (dots per inch) of the fingerprint image. This is the DPI of the image later passed to create(byte[]). Check your fingerprint reader specification for correct DPI value. Default DPI is 500.
        dpi - DPI of the fingerprint image, usually around 500
        this (fluent method)
        See Also:
      • create

        public FingerprintTemplate create(byte[] image)
        Create fingerprint template from fingerprint image. The image must contain black fingerprint on white background at the DPI specified by calling dpi(double).
        The image may be in any format commonly used to store fingerprint images, including PNG, JPEG, BMP, TIFF, or WSQ. SourceAFIS will try to decode the image using Java's ImageIO (PNG, JPEG, BMP), Sanselan library (TIFF), and JNBIS library (WSQ) in this order. Note that these libraries might not support all variations of the mentioned formats.
        This method replaces any previously added biometric data in this template.
        image - fingerprint image in ImageIO-supported format
        this (fluent method)
        See Also:
      • deserialize

        public FingerprintTemplate deserialize(String json)
        Deserialize fingerprint template from JSON string. This method reads JSON string produced by 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)
        See Also:
        serialize(), Template format
      • serialize

        public String serialize()
        Serialize fingerprint template to JSON string. Serialized template can be stored in a database or sent over network. It can be deserialized by calling 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.
        serialized fingerprint template in JSON format
        See Also:
        deserialize(String), Template format