Skip to main content

pyfing - Fingerprint recognition in Python

Simple but effective methods for fingerprint recognition.

Getting Started

Installation

You can install the library via pip (make sure Keras 3, TensorFlow, and OpenCV are already installed):

pip install pyfing

Quick Example

The following example shows how to load an image, segment it, estimate orientation and frequency, enhance the image, and finally extract minutiae:

import cv2 as cv
import pyfing as pf

# Load the fingerprint image in grayscale
fingerprint = cv.imread('fingerprint.png', cv.IMREAD_GRAYSCALE)

# Segmentation and feature extraction
segmentation_mask = pf.fingerprint_segmentation(fingerprint)
orientations = pf.orientation_field_estimation(fingerprint, segmentation_mask)
frequencies = pf.frequency_estimation(fingerprint, orientations, segmentation_mask)

# Image enhancement
enhanced_image = pf.fingerprint_enhancement(fingerprint, orientations, frequencies, segmentation_mask, method="GBFEN")

# End-to-end minutiae extraction (Note: this method does NOT require previous steps)
minutiae = pf.minutiae_extraction(fingerprint)

Available methods

Below you can find an overview of the different methods available in pyfing for each step of the fingerprint recognition pipeline.

Fingerprint segmentation

The following segmentation methods are available:

  • GMFS (Gradient-Magnitude Fingerprint Segmentation): straightforward yet effective approach, achieving superior performance compared to previously reported traditional (non deep-learning-based) methods. Its average error rate on the FVC segmentation benchmark [1] is 2.98%.
  • SUFS (Simplified U-net Fingerprint Segmentation): method based on a simplified U-net architecture that surpasses all previous methods evaluated on the FVC segmentation benchmark [1]. Its average error rate on the benchmark is 1.51%.

See [2] for a complete description of the two segmentation methods.

Fingerprint orientation field estimation

The following orientation field estimation methods are available:

  • GBFOE (Gradient-Based Fingerprint Orientation Estimation): a simple fingerprint orientation estimation method based on traditional image processing techniques with minimal computational resource requirements that achieves performance comparable to much more complex methods. It achieves an average error of 5.30° and 14.40° on the "good" and "bad" datasets of the FOE-STD-1.0 benchmark [3], respectively.
  • SNFOE (Simple Network for Fingerprint Orientation Estimation): learning-based fingerprint orientation estimation method that surpasses all previous methods evaluated on public benchmarks and can deal both with plain fingerprints acquired through online sensors, and with latent fingerprints, without requiring any fine-tuning. It achieves an average error of 4.30° and 6.37° on the "good" and "bad" datasets of the FOE-STD-1.0 benchmark [3], respectively.

See [4] for a complete description of the two orientation field estimation methods.

Fingerprint frequency estimation

The following frequency estimation methods are available:

  • XSFFE (X-Signature-based Fingerprint Frequency Estimation): a simple fingerprint frequency estimation method based on traditional image processing techniques and on the computation of the x-signature. It achieves an average error of 5.10% and 7.84% on the "good" and "bad" datasets of the FFE benchmark [5], respectively.
  • SNFFE (Simple Network for Fingerprint Frequency Estimation): learning-based fingerprint frequency estimation method that surpasses all previous methods evaluated on the FFE benchmark. It achieves an average error of 3.62% and 6.69% on the "good" and "bad" datasets of the FFE benchmark [5], respectively.

See [6] for a complete description of the two frequency estimation methods.

Fingerprint enhancement

The following enhancement methods are available:

  • GBFEN (Gabor-Based Fingerprint ENhancement): a simple fingerprint enhancement method based on traditional contextual convolution with Gabor filters. Combined with SNFOE and SNFFE, it surpasses the performance of state-of-the-art methods on the challenging NIST SD27 latent fingerprint database [7].
  • SNFEN (Simple Network for Fingerprint ENhancement): learning-based fingerprint enhancement method that achieves even better results while maintaining simplicity, linearity, and ease of implementation.

See [8] for a complete description of the two fingerprint enhancement methods.

End-to-end minutiae extraction

The following end-to-end minutia extraction method is available:

  • LEADER (Lightweight End-to-end Attention-gated Dual Encoder-decodeR): a neural network that maps raw fingerprint images to minutiae descriptors, including location, direction, and type. With only 0.9 M parameters, it achieves state-of-the-art accuracy on plain fingerprints and robust cross-domain generalization to latent impressions.

See [9] for a complete description of LEADER.

References

[1] D. H. Thai, S. Huckemann and C. Gottschlich, "Filter Design and Performance Evaluation for Fingerprint Image Segmentation," PLOS ONE, vol. 11, pp. 1-31, May 2016.

[2] R. Cappelli, "Unveiling the Power of Simplicity: Two Remarkably Effective Methods for Fingerprint Segmentation," in IEEE Access, vol. 11, pp. 144530-144544, 2023, doi: 10.1109/ACCESS.2023.3345644.

[3] FOE benchmarks on FVC-onGoing, https://biolab.csr.unibo.it/fvcongoing/UI/Form/BenchmarkAreas/BenchmarkAreaFOE.aspx.

[4] R. Cappelli, "Exploring the Power of Simplicity: A New State-of-the-Art in Fingerprint Orientation Field Estimation," in IEEE Access, vol. 12, pp. 55998-56018, 2024, doi: 10.1109/ACCESS.2024.3389701.

[5] FFE Benchmark, https://github.com/raffaele-cappelli/FFE.

[6] R. Cappelli, "No Feature Left Behind: Filling the Gap in Fingerprint Frequency Estimation," in IEEE Access, vol. 12, pp. 153605-153617, 2024, doi: 10.1109/ACCESS.2024.3481507.

[7] M. D. Garris and R. M. McCabe, NIST Special Database 27: Fingerprint Minutiae from Latent and Matching Tenprint Images, 2000.

[8] R. Cappelli, "Unleashing the Power of Simplicity: A Minimalist Strategy for State-of-the-Art Fingerprint Enhancement", 2026, arXiv preprint arXiv:2603.19004. https://arxiv.org/abs/2603.19004.

[9] R. Cappelli and M. Ferrara, "LEADER: Lightweight End-to-End Attention-Gated Dual Autoencoder for Robust Minutiae Extraction," 2026, arXiv preprint arXiv:2602.15493. https://arxiv.org/abs/2602.15493.

Metadata

Release files for pyfing 0.7.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyfing 0.7.3
File Size Uploaded Provenance
pyfing-0.7.3.tar.gz 84.7 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pyfing 0.7.3
File Interpreter ABI Platform
pyfing-0.7.3-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 169.4 MB

Release files / pyfing-0.7.3.tar.gz

Download URL pyfing-0.7.3.tar.gz
Size 84.7 MB
Tags Source
SHA-256 checksum
How to use checksums
4d121613d06d159064cdf2a2cddfdcb1d51664728cecd86f7c074a31397a4e19
BLAKE2b-256 checksum
How to use checksums
f12ed05bba69dd7f6a3505b182483408c311fab884c91cc6fea6ffc5b8a92371
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Release files / pyfing-0.7.3-py2.py3-none-any.whl

Download URL pyfing-0.7.3-py2.py3-none-any.whl
Size 84.7 MB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
4e11f7abd61d0782746161892862e554d845d73725e2a9822c13adf9231fd138
BLAKE2b-256 checksum
How to use checksums
4046e173cdbe5f62c9a5aea7c1fd724ad9ba530f44ccdc8250414a631fc81b4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Security for pyfing 0.7.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page