com.machinezoo.sourceafis

Class FingerprintImage

SourceAFIS for Java » API Reference » FingerprintImage

    • Method Detail

      • dpi

        public FingerprintImage dpi(double dpi)
        Set DPI (dots per inch) of the fingerprint image. This is the DPI of the image passed to decode(byte[]) or grayscale(int, int, 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)
        Throws:
        IllegalArgumentException - if dpi is non-positive, impossibly low, or impossibly high
        See Also:
        decode(byte[])
      • grayscale

        public FingerprintImage grayscale(int width,
                                          int height,
                                          byte[] pixels)
        Load raw grayscale fingerprint image from byte array. The image must contain black fingerprint on white background at the DPI specified by calling 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 in pixels array are ordered from top-left to bottom-right in horizontal rows. Size of pixels must be equal to width * 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
        Returns:
        this (fluent method)
        Throws:
        NullPointerException - if image is null
        IndexOutOfBoundsException - if width or height is not positive or if pixels length is not width * height
        See Also:
        dpi(double), decode(byte[])