com.machinezoo.sourceafis

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 one of the methods create(byte[]), deserialize(String), or convert(byte[]) 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.
        Parameters:
        dpi - DPI of the fingerprint image, usually around 500
        Returns:
        this (fluent method)
        See Also:
        create(byte[])
      • create

        public FingerprintTemplate create(byte[] image)
        Create fingerprint template from fingerprint image. Image must contain black fingerprint on white background at the DPI specified by calling 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.
        Parameters:
        image - fingerprint image in ImageIO-supported format
        Returns:
        this (fluent method)
        See Also:
        dpi(double)
      • 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.
        Parameters:
        json - serialized fingerprint template in JSON format produced by serialize()
        Returns:
        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.
        Returns:
        serialized fingerprint template in JSON format
        See Also:
        deserialize(String), Template format
      • convert

        public FingerprintTemplate convert(byte[] iso)
        Import ISO 19794-2 fingerprint template from another fingerprint recognition system. This method can import biometric data from ISO 19794-2 templates, which carry fingerprint features (endings and bifurcations) without the original image.
        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.
        Parameters:
        iso - ISO 19794-2 template to import
        Returns:
        this (fluent method)
        See Also:
        create(byte[]), deserialize(String), serialize()