sourceafis.simple
Class Fingerprint

java.lang.Object
  extended by sourceafis.simple.Fingerprint
All Implemented Interfaces:
Serializable, Cloneable

public class Fingerprint
extends Object
implements Cloneable, Serializable

Collection of fingerprint-related information. This class contains basic information (image, template) about the fingerprint that is used by SourceAFIS to perform template extraction and fingerprint matching. If you need to attach application-specific information to Fingerprint object, inherit from this class and add fields as necessary. Fingerprint objects can be grouped in Person objects.

This class is designed to be easy to serialize in order to be stored in binary format (BLOB) in application database, binary or XML files, or sent over network. You can either serialize the whole object or serialize individual properties. You can set some properties to null to exclude them from serialization.

See Also:
Person

Constructor Summary
Fingerprint()
          Creates empty Fingerprint object.
 
Method Summary
 Fingerprint clone()
          Creates deep copy of the Fingerprint object.
 Finger getFinger()
          Gets position of the finger on hand.
 byte[][] getImage()
          Gets fingerprint image.
 byte[] getIsoTemplate()
          Gets fingerprint template in standard ISO format.
 byte[] getTemplate()
          Gets fingerprint template.
 Element getXmlTemplate()
          Gets fingerprint template in readable XML format.
 void setFinger(Finger value)
          Sets position of the finger on hand.
 void setImage(byte[][] newImage)
          Sets fingerprint image.
 void setIsoTemplate(byte[] value)
          Sets fingerprint template in standard ISO format.
 void setTemplate(byte[] value)
          Sets fingerprint template.
 void setXmlTemplate(Element value)
          Sets fingerprint template in readable XML format.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Fingerprint

public Fingerprint()
Creates empty Fingerprint object.

Method Detail

getImage

public byte[][] getImage()
Gets fingerprint image. This is the raw fingerprint image that was used to extract the template or other image attached later after extraction. This property is null by default. See setImage for further explanation.

Return value is not cloned internally. To avoid unwanted sharing, clone the image data after calling this method.

Returns:
fingerprint image or null
See Also:
setImage, getTemplate, AfisEngine.extract

setImage

public void setImage(byte[][] newImage)
Sets fingerprint image. Image must be set before call to AfisEngine.extract in order to generate valid template. Once the template is generated, fingerprint image has only informational meaning and it can be set to null to save space. It is however recommended to keep the original image just in case it is needed to regenerate the template in future.

The format of this image is a simple raw 2D array of bytes. Every byte represents shade of gray from black (0) to white (255). When indexing the 2D array, Y axis goes first, X axis goes second, e.g. image[y][x].

Parameter value is not cloned internally. To avoid unwanted sharing, clone the image data before calling this method.

Parameters:
newImage - new fingerprint image for this fingerprint or null
See Also:
getImage, setTemplate, AfisEngine.extract

getTemplate

public byte[] getTemplate()
Gets fingerprint template. Fingerprint template is generated by AfisEngine.extract. Alternatively it can be other template assigned for example after deserialization. This property is null by default.

Fingerprint template is an abstract model of the fingerprint that is serialized in a very compact binary format (up to a few KB). Templates are better than fingerprint images, because they require less space and they are easier to match than images. To generate the template, pass Fingerprint object with valid image to AfisEngine.extract. Valid template is required by AfisEngine.verify and AfisEngine.identify.

Format of the template may change in later versions of SourceAFIS. Applications are recommended to keep the original image in order to be able to regenerate the template. Value of finger property is not automatically stored in the template. It must be stored separately.

Returns:
fingerprint's current template in native format
See Also:
setTemplate, AfisEngine.extract, getIsoTemplate, getXmlTemplate

setTemplate

public void setTemplate(byte[] value)
Sets fingerprint template. For complete description, see getTemplate. Most applications don't need to call this method. Template is usually automatically set by AfisEngine.extract. Application might wish to set template explicitly for example when deserializing the fingerprint.

Parameters:
value - fingerprint's new template in native format
See Also:
getTemplate, AfisEngine.extract, setIsoTemplate, setXmlTemplate

getIsoTemplate

public byte[] getIsoTemplate()
Gets fingerprint template in standard ISO format. This is the value of getTemplate converted to standard ISO/IEC 19794-2 (2005) format. The result is null if getTemplate returns null.

Use this method together with setIsoTemplate for two-way exchange of fingerprint templates with other biometric systems. For general use in SourceAFIS, use getTemplate method which returns native template that is fine-tuned for best accuracy and performance in SourceAFIS.

SourceAFIS contains partial implementation of ISO/IEC 19794-2 (2005) standard. Multi-fingerprint ISO templates must be split into individual fingerprints before they are used in SourceAFIS. Value of finger property is not automatically stored in the ISO template. It must be decoded separately.

Returns:
fingerprint's current template in standard ISO format
See Also:
setIsoTemplate, AfisEngine.extract, getTemplate, getXmlTemplate

setIsoTemplate

public void setIsoTemplate(byte[] value)
Sets fingerprint template in standard ISO format. The parameter is converted from standard ISO/IEC 19794-2 (2005) format to native format and passed to setTemplate. If the parameter is null, setTemplate will be called with null parameter. See getIsoTemplate for details.

Parameters:
value - fingerprint's new template in standard ISO format
See Also:
getIsoTemplate, AfisEngine.extract, setTemplate, setXmlTemplate

getXmlTemplate

public Element getXmlTemplate()
Gets fingerprint template in readable XML format. This is the value of getTemplate converted to SourceAFIS XML template format. The result is null if getTemplate returns null.

Use XML template format where clean data format is more important than compact and fast encoding. XML templates are suitable for XML-based data exchange, encoding of multiple fingerprints along with accompanying data into single XML file, and for debugging and logging purposes.

Value of finger property is not automatically stored in the XML template. It must be stored separately.

Returns:
fingerprint's current template in SourceAFIS XML format
See Also:
setXmlTemplate, AfisEngine.extract, getTemplate, getIsoTemplate

setXmlTemplate

public void setXmlTemplate(Element value)
Sets fingerprint template in readable XML format. The parameter is converted from SourceAFIS XML template format to native format and passed to setTemplate. If the parameter is null, setTemplate will be called with null parameter. See getXmlTemplate for details.

Parameters:
value - fingerprint's new template in SourceAFIS XML format
See Also:
getXmlTemplate, AfisEngine.extract, setTemplate, setIsoTemplate

getFinger

public Finger getFinger()
Gets position of the finger on hand. See setFinger for explanation. This method just retrieves current finger position.

See Also:
setFinger, Finger

setFinger

public void setFinger(Finger value)
Sets position of the finger on hand. Sets finger (thumb to little) and hand (right or left) that was used to create this fingerprint. Default value Finger.ANY means unspecified finger position.

Finger position is used to speed up matching by skipping fingerprint pairs with incompatible finger positions. Check Finger enumeration for information on how to control this process. Default value Finger.ANY disables this behavior.

Parameters:
value - new finger position for this fingerprint
See Also:
getFinger, Finger

clone

public Fingerprint clone()
Creates deep copy of the Fingerprint object.

Overrides:
clone in class Object
Returns:
deep copy of this object