- java.lang.Object
-
- com.machinezoo.sourceafis.FingerprintImage
-
public class FingerprintImage extends Object
Pixels and metadata of the fingerprint image. This class captures all fingerprint information that is available prior to construction ofFingerprintTemplate
. It consists of pixel data and additional information inFingerprintImageOptions
. Since SourceAFIS algorithm is not scale-invariant, all images should have DPI configured explicitly by callingFingerprintImageOptions.dpi(double)
.Application should start fingerprint processing by constructing an instance of
FingerprintImage
and then passing it toFingerprintTemplate(FingerprintImage)
.Fingerprint image can be either in one of the supported image formats (PNG, JPEG, ...), in which case constructor
FingerprintImage(byte[], FingerprintImageOptions)
is used, or it can be a raw grayscale image, for which constructorFingerprintImage(int, int, byte[], FingerprintImageOptions)
is used.- See Also:
-
FingerprintImageOptions
,FingerprintTemplate
-
-
Constructor Summary
Constructors Constructor Description FingerprintImage()
Deprecated.Use one of the constructors that fully initialize the object.FingerprintImage(byte[] image)
Decodes fingerprint image in standard format using default options.FingerprintImage(byte[] image, FingerprintImageOptions options)
Decodes fingerprint image in standard format.FingerprintImage(int width, int height, byte[] pixels)
Reads raw grayscale fingerprint image from byte array using default options.FingerprintImage(int width, int height, byte[] pixels, FingerprintImageOptions options)
Reads raw grayscale fingerprint image from byte array.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description FingerprintImage
decode(byte[] image)
Deprecated.UseFingerprintImage(byte[], FingerprintImageOptions)
constructor to decode image in standard format.FingerprintImage
dpi(double dpi)
Deprecated.Set DPI viaFingerprintImageOptions.dpi(double)
instead.FingerprintImage
grayscale(int width, int height, byte[] pixels)
Deprecated.UseFingerprintImage(int, int, byte[], FingerprintImageOptions)
constructor to read raw image.
-
-
-
Constructor Detail
-
FingerprintImage
public FingerprintImage(byte[] image, FingerprintImageOptions options)
Decodes fingerprint image in standard format. The image must contain black fingerprint on white background in resolution specified by callingFingerprintImageOptions.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, and on Java 9+ TIFF), JNBIS library (WSQ), and Android's Bitmap class (PNG, JPEG, BMP) in this order. Note that these libraries might not support all versions and variations of the mentioned formats.- Parameters:
-
image
- fingerprint image in one of the supported formats -
options
- additional information about the image ornull
for default options - Throws:
-
NullPointerException
- ifimage
isnull
-
IllegalArgumentException
- if the image format is unsupported or the image is corrupted - See Also:
-
FingerprintImage(int, int, byte[], FingerprintImageOptions)
,FingerprintImage(byte[])
,FingerprintCompatibility.convert(byte[])
,FingerprintTemplate(byte[])
-
FingerprintImage
public FingerprintImage(byte[] image)
Decodes fingerprint image in standard format using default options. This constructor is equivalent to callingFingerprintImage(byte[], FingerprintImageOptions)
with defaultFingerprintImageOptions
.- Parameters:
-
image
- fingerprint image in one of the supported formats - Throws:
-
NullPointerException
- ifimage
isnull
-
IllegalArgumentException
- if the image format is unsupported or the image is corrupted - See Also:
-
FingerprintImage(byte[], FingerprintImageOptions)
,FingerprintImage(int, int, byte[])
,FingerprintCompatibility.convert(byte[])
,FingerprintTemplate(byte[])
-
FingerprintImage
public FingerprintImage(int width, int height, byte[] pixels, FingerprintImageOptions options)
Reads raw grayscale fingerprint image from byte array. The image must contain black fingerprint on white background in resolution specified by callingFingerprintImageOptions.dpi(double)
.Pixels are represented as 8-bit unsigned bytes with 0 meaning black and 255 meaning white. Java's byte is a signed 8-bit number, but this method interprets all 8 bits as an unsigned number as if by calling
Byte.toUnsignedInt(byte)
. Pixels inpixels
array are ordered from top-left to bottom-right in horizontal rows. Size ofpixels
must be equal towidth * height
.- Parameters:
-
width
- width of the image -
height
- height of the image -
pixels
- image pixels ordered from top-left to bottom-right in horizontal rows -
options
- additional information about the image ornull
for default options - Throws:
-
NullPointerException
- ifpixels
isnull
-
IndexOutOfBoundsException
- ifwidth
orheight
is not positive or ifpixels
length is notwidth * height
- See Also:
-
FingerprintImage(byte[], FingerprintImageOptions)
,FingerprintImage(int, int, byte[])
,FingerprintCompatibility.convert(byte[])
,FingerprintTemplate(byte[])
-
FingerprintImage
public FingerprintImage(int width, int height, byte[] pixels)
Reads raw grayscale fingerprint image from byte array using default options. This constructor is equivalent to callingFingerprintImage(int, int, byte[], FingerprintImageOptions)
with defaultFingerprintImageOptions
.- Parameters:
-
width
- width of the image -
height
- height of the image -
pixels
- image pixels ordered from top-left to bottom-right in horizontal rows - Throws:
-
NullPointerException
- ifpixels
isnull
-
IndexOutOfBoundsException
- ifwidth
orheight
is not positive or ifpixels
length is notwidth * height
- See Also:
-
FingerprintImage(int, int, byte[], FingerprintImageOptions)
,FingerprintImage(byte[])
,FingerprintCompatibility.convert(byte[])
,FingerprintTemplate(byte[])
-
FingerprintImage
@Deprecated public FingerprintImage()
Deprecated.Use one of the constructors that fully initialize the object.
-
-
Method Detail
-
dpi
@Deprecated public FingerprintImage dpi(double dpi)
Deprecated.Set DPI viaFingerprintImageOptions.dpi(double)
instead.- Parameters:
-
dpi
- DPI of the fingerprint image - Returns:
-
this
(fluent method) - Throws:
-
IllegalArgumentException
- ifdpi
is non-positive, impossibly low, or impossibly high - See Also:
-
FingerprintImageOptions.dpi(double)
-
decode
@Deprecated public FingerprintImage decode(byte[] image)
Deprecated.UseFingerprintImage(byte[], FingerprintImageOptions)
constructor to decode image in standard format.- Parameters:
-
image
- fingerprint image in one of the supported formats - Returns:
-
this
(fluent method) - Throws:
-
NullPointerException
- ifimage
isnull
-
IllegalArgumentException
- if the image format is unsupported or the image is corrupted - See Also:
-
FingerprintImage(byte[], FingerprintImageOptions)
-
grayscale
@Deprecated public FingerprintImage grayscale(int width, int height, byte[] pixels)
Deprecated.UseFingerprintImage(int, int, byte[], FingerprintImageOptions)
constructor to read raw image.- Parameters:
-
width
- width of the image -
height
- height of the image -
pixels
- image pixels ordered from top-left to bottom-right in horizontal rows - Returns:
-
this
(fluent method) - Throws:
-
NullPointerException
- ifimage
isnull
-
IndexOutOfBoundsException
- ifwidth
orheight
is not positive or ifpixels
length is notwidth * height
- See Also:
-
FingerprintImage(int, int, byte[], FingerprintImageOptions)
-
-