Expand description
§fprint-pipeline
The host-image fingerprint pipeline. It joins the three published leaves —
fprint_mindtct (minutiae detection), fprint_bozorth3 (minutiae matching) and
fprint_core (the domain Print / Template /
Minutia) — into the one path a host-image sensor walks:
image → minutiae → template → match.
The two kernels are dependency-free and each defines its own Minutia (the xyt triple is an
interoperability fact, not a shared type). This crate owns the small conversions between them
and the domain model:
extract_minutiae/template_from_images— the front half, overfprint_mindtct.nbis_match_score(→MatchScore) /nbis_verify/nbis_identify— the back half, overfprint_bozorth3.minutia_to_core/minutiae_to_bozorth— the boundary conversions, exposed for callers that assemble their own pipeline.
Add just this crate: it re-exports fprint_core, fprint_mindtct and fprint_bozorth3, so
the domain types and the kernels are reachable without naming them as separate dependencies.
§Image → template → match
use fprint_pipeline::{
nbis_identify, nbis_match_score, nbis_verify, template_from_images, GrayImage,
};
// A procedural fingerprint-like frame: dark horizontal ridges with a gap cut into every other
// ridge. A gap ends a ridge, and a ridge ending is a minutia (plain stripes would have none).
fn synthetic_frame() -> Vec<u8> {
let (w, h) = (128usize, 128usize);
(0..w * h)
.map(|i| {
let (x, y) = (i % w, i / w);
let on_ridge = (y % 8) < 4;
let gap = (48..80).contains(&x) && (y / 8) % 2 == 0;
if on_ridge && !gap { 32 } else { 224 }
})
.collect()
}
// Enroll one capture, then take a second capture of the same finger as the probe.
let frame = synthetic_frame();
let img = GrayImage::new(&frame, 128, 128, 500).expect("buffer holds the image");
let enrolled = template_from_images(&[img]);
let frame2 = synthetic_frame();
let scan = GrayImage::new(&frame2, 128, 128, 500).expect("buffer holds the image");
let scanned = template_from_images(&[scan]);
// Verify (1:1): a bool decision against a driver threshold, or read the raw score.
let threshold = 40;
let _accepted: bool = nbis_verify(&enrolled, &scanned, threshold);
let score: Option<u32> = nbis_match_score(&enrolled, &scanned).score();
// A same-finger recapture out-scores an unrelated print; the caller picks the accept threshold.
let stranger = template_from_images(&[]);
assert!(score >= nbis_match_score(&enrolled, &stranger).score());
// Identify (1:N): the gallery index whose enrolled template best matches the probe.
let gallery = vec![enrolled, stranger];
assert_eq!(nbis_identify(&scanned, &gallery, 0), Some(0));§Persistence
This crate stops at the in-memory Template. To write an enrolled print
to disk in the format libfprint reads and writes, add fprint-fp3 and call its to_bytes /
from_bytes on a Print carrying the template — persistence is a
separate, single-purpose crate.
Re-exports§
pub use fprint_bozorth3;pub use fprint_core;pub use fprint_mindtct;
Modules§
- prelude
- The handful of names the common path uses: the pipeline functions, the
GrayImageinput, and the domainPrint/Template/Minutiathe functions produce and consume.
Structs§
- Gray
Image - An 8-bit grayscale fingerprint image, row-major, one byte per pixel.
Enums§
- Image
Error - The error
GrayImage::newreturns when the supplied image cannot be processed by MINDTCT. - Match
Score - The outcome of scoring one template against another.
Constants§
- MIN_
DETECTABLE_ DIM - The smallest image dimension MINDTCT can process, in pixels.
Functions§
- extract_
minutiae - Detect the minutiae in a captured 8-bit grayscale frame, as
fprint_core::Minutias. - minutia_
to_ core - Convert one MINDTCT
fprint_mindtct::Minutiainto anfprint_core::Minutia. - minutiae_
to_ bozorth - Convert a slice of domain
fprint_core::Minutiaintofprint_bozorth3::Minutias ready to score. - nbis_
identify - Identify (1:N): the
galleryindex whose enrolled template best matchesscannedand clearsthreshold, orNoneif none does. - nbis_
match_ score - Score a
scannedprobe template against anenrolledone. - nbis_
verify - Verify (1:1): whether
scannedmatchesenrolledat or abovethreshold. - template_
from_ images - Build a host-side
fprint_core::Template::Nbisfrom a set of captured frames.