Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/usnistgov/NFIQ2/llms.txt

Use this file to discover all available pages before exploring further.

Overview

The NFIQ2::FingerprintImageData class represents binary data for a decompressed fingerprint image, canonically encoded as per ISO/IEC 39794-4:2019. This class inherits from NFIQ2::Data and adds fingerprint-specific metadata.

Class Definition

namespace NFIQ2 {
    class FingerprintImageData : public Data {
        // Public interface
    };
}

Constants

Resolution500PPI

static const uint16_t Resolution500PPI { 500 };
Standard 500 PPI (pixels per inch) resolution constant.

Constructors

Default Constructor

FingerprintImageData();
Default constructor.

Metadata-Only Constructor

FingerprintImageData(
    uint32_t width,
    uint32_t height,
    uint8_t fingerCode,
    uint16_t ppi);
Constructor that does not store image data.
width
uint32_t
Width of the image in pixels.
height
uint32_t
Height of the image in pixels.
fingerCode
uint8_t
Finger position of the fingerprint in the image.
ppi
uint16_t
Resolution of the image in pixels per inch.

Full Constructor

FingerprintImageData(
    const uint8_t *pData,
    uint32_t dataSize,
    uint32_t width,
    uint32_t height,
    uint8_t fingerCode,
    uint16_t ppi);
Constructor storing image data.
pData
const uint8_t *
Pointer to decompressed 8 bit-per-pixel grayscale image data, canonically encoded as per ISO/IEC 39794-4:2019.
dataSize
uint32_t
Size of the buffer pointed to by pData.
width
uint32_t
Width of the image in pixels.
height
uint32_t
Height of the image in pixels.
fingerCode
uint8_t
Finger position of the fingerprint in the image.
ppi
uint16_t
Resolution of the image in pixels per inch.

Copy Constructor

FingerprintImageData(const FingerprintImageData &otherData);
Copy constructor.

Public Members

width

uint32_t width { 0 };
Width of the fingerprint image in pixels.

height

uint32_t height { 0 };
Height of the fingerprint image in pixels.

fingerCode

uint8_t fingerCode { 0 };
ISO finger code of the fingerprint in the image.

ppi

uint16_t ppi { Resolution500PPI };
Pixels per inch of the fingerprint image. Defaults to 500 PPI.

Methods

copyRemovingNearWhiteFrame

NFIQ2::FingerprintImageData copyRemovingNearWhiteFrame() const;
Obtain a copy of the image with near-white lines surrounding the fingerprint removed.
return
NFIQ2::FingerprintImageData
Cropped fingerprint image.
Throws: NFIQ2::Exception if error performing the crop, or the image is too small to be processed after cropping.

Inherited Methods from Data

Since FingerprintImageData inherits from NFIQ2::Data, the following methods are also available:

readFromFile

void readFromFile(const std::string &filename);
Reads the content from a file into this object. Throws: NFIQ2::Exception if file cannot be opened.

writeToFile

void writeToFile(const std::string &filename) const;
Writes the content to a file. Throws: NFIQ2::Exception if file cannot be opened.

toHexString

std::string toHexString() const;
Generates a string in hexadecimal format of the buffer. Throws: NFIQ2::Exception if no data available in buffer.

fromBase64String

void fromBase64String(const std::string &base64String);
Imports data from a Base64 encoded string. Throws: NFIQ2::Exception if invalid character is detected in string.

toBase64String

std::string toBase64String() const;
Generates a string in Base64 format of the buffer.

Usage Example

#include <nfiq2_fingerprintimagedata.hpp>

// Create fingerprint image data from raw pixels
uint8_t* pixels = /* ... load image data ... */;
uint32_t width = 640;
uint32_t height = 480;
uint8_t fingerCode = 1;  // Right thumb
uint16_t ppi = NFIQ2::FingerprintImageData::Resolution500PPI;

NFIQ2::FingerprintImageData imageData(
    pixels,
    width * height,
    width,
    height,
    fingerCode,
    ppi
);

// Remove near-white borders
NFIQ2::FingerprintImageData cropped = imageData.copyRemovingNearWhiteFrame();

Image Format Requirements

The fingerprint image must be:
  • 8 bit-per-pixel grayscale
  • Decompressed (raw pixels)
  • Canonically encoded as per ISO/IEC 39794-4:2019

See Also

  • Algorithm - Uses FingerprintImageData for quality scoring
  • Data - Base class for binary data handling

Build docs developers (and LLMs) love