pgafis
pgafis · AFIS Support for PostgreSQL
Overview
Usage
Sources:
pgafis adds Automated Fingerprint Identification System primitives to PostgreSQL. It compresses fingerprint images, extracts and inspects minutiae templates, measures image quality, and scores one-to-one or one-to-many template matches. The extension wraps the legacy NIST Biometric Image Software (NBIS) libraries; it does not provide an indexed search method or decide an application’s identity threshold.
Core Workflow
Install the extension, then store the original image and derived artifacts separately. The upstream examples use raw PGM images, WSQ-compressed images, binary MDT templates, and text XYT minutiae:
Compare two templates with bz_match. Its integer result is a similarity score; the application must choose and validate an appropriate threshold for its own data:
For one-to-many identification, score candidate rows and order or filter them explicitly. The upstream example performs a sequential scan, so benchmark the candidate population before placing this operation on a request path.
Function Index
cwsq(bytea, real, int, int, int, int) -> byteaencodes a raw fingerprint image as WSQ.nfiq(bytea) -> intcomputes an NFIQ image-quality score.mindt(bytea)andmindt(bytea, boolean) -> byteaextract a binary minutiae template.mdt2text(bytea) -> textrenders a template as text, andmdt_mins(bytea) -> intcounts its minutiae.bz_match(bytea, bytea) -> intandbz_match(text, text) -> intcalculate Bozorth3 match scores for binary or text templates.
Operational Notes
Version 1.2 is relocatable and does not declare a preload requirement. Its pinned build files, however, hard-code NBIS 5.0.0 under /opt/nbis-5.0.0, statically link the NBIS archives, pass -m32, and retain a PostgreSQL 9.3 in-tree build default. Treat those as substantial portability constraints: rebuild and test against the exact PostgreSQL, compiler, architecture, NBIS, and image-library stack you intend to run.
Fingerprint templates and thresholds are biometric security decisions, not generic constants. Validate false-accept and false-reject behavior with representative data, restrict access to raw images and templates, and avoid presenting a match score as an identity guarantee.