- java.lang.Object
-
- com.machinezoo.sourceafis.FingerprintMatcher
-
public class FingerprintMatcher extends Object
Fingerprint template representation optimized for fast 1:N matching.FingerprintMatcher
maintains data structures that improve matching speed at the cost of some RAM. It can efficiently match one probe fingerprint to many candidate fingerprints.New matcher is created by passing probe fingerprint template to
FingerprintMatcher(FingerprintTemplate)
constructor. Candidate fingerprint templates are then passed one by one tomatch(FingerprintTemplate)
method.- See Also:
-
SourceAFIS for Java tutorial,
FingerprintTemplate
-
-
Constructor Summary
Constructors Constructor Description FingerprintMatcher()
Deprecated.UseFingerprintMatcher(FingerprintTemplate)
constructor to fully initialize the matcher.FingerprintMatcher(FingerprintTemplate probe)
Creates fingerprint template representation optimized for fast 1:N matching.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description FingerprintMatcher
index(FingerprintTemplate probe)
Deprecated.UseFingerprintMatcher(FingerprintTemplate)
constructor to initialize the matcher.double
match(FingerprintTemplate candidate)
Matches candidate fingerprint to probe fingerprint and calculates similarity score.int
memory()
Estimates memory footprint of this object.FingerprintMatcher
transparency(FingerprintTransparency transparency)
Deprecated.Use thread-local instance ofFingerprintTransparency
instead.
-
-
-
Constructor Detail
-
FingerprintMatcher
public FingerprintMatcher(FingerprintTemplate probe)
Creates fingerprint template representation optimized for fast 1:N matching. Once the probe template is processed, candidate templates can be compared to it by callingmatch(FingerprintTemplate)
.This constructor is expensive in terms of RAM footprint and CPU usage. Initialized
FingerprintMatcher
should be reused for multiplematch(FingerprintTemplate)
calls in 1:N matching.- Parameters:
-
probe
- probe fingerprint template to be matched to candidate fingerprints - Throws:
-
NullPointerException
- ifprobe
isnull
- See Also:
-
match(FingerprintTemplate)
-
FingerprintMatcher
@Deprecated public FingerprintMatcher()
Deprecated.UseFingerprintMatcher(FingerprintTemplate)
constructor to fully initialize the matcher.- See Also:
-
FingerprintMatcher(FingerprintTemplate)
-
-
Method Detail
-
transparency
@Deprecated public FingerprintMatcher transparency(FingerprintTransparency transparency)
Deprecated.Use thread-local instance ofFingerprintTransparency
instead.- Parameters:
-
transparency
- targetFingerprintTransparency
ornull
to disable algorithm transparency - Returns:
-
this
(fluent method) - See Also:
-
FingerprintTransparency
-
index
@Deprecated public FingerprintMatcher index(FingerprintTemplate probe)
Deprecated.UseFingerprintMatcher(FingerprintTemplate)
constructor to initialize the matcher.- Parameters:
-
probe
- probe fingerprint template to be matched to candidate fingerprints - Returns:
-
this
(fluent method) - Throws:
-
NullPointerException
- ifprobe
isnull
- See Also:
-
FingerprintMatcher(FingerprintTemplate)
-
match
public double match(FingerprintTemplate candidate)
Matches candidate fingerprint to probe fingerprint and calculates similarity score. Candidate fingerprint incandidate
parameter is matched to probe fingerprint previously passed toFingerprintMatcher(FingerprintTemplate)
constructor.Returned similarity score is a non-negative number that increases with similarity between probe and candidate fingerprints. Application should compare the score to a threshold with expression
(score >= threshold)
to arrive at boolean match/non-match decision. Threshold 10 corresponds to FMR (False Match Rate, see Biometric Performance and Confusion matrix) of 10%, threshold 20 to FMR 1%, threshold 30 to FMR 0.1%, and so on.Recommended threshold is 40, which corresponds to FMR 0.01%. Correspondence between threshold and FMR is approximate and varies with quality of fingerprints being matched. Increasing threshold rapidly reduces FMR, but it also slowly increases FNMR (False Non-Match Rate). Threshold must be tailored to the needs of the application.
This method is thread-safe. Multiple threads can match candidates against single
FingerprintMatcher
.- Parameters:
-
candidate
- fingerprint template to be matched with probe fingerprint represented by thisFingerprintMatcher
- Returns:
- similarity score between probe and candidate fingerprints
- Throws:
-
NullPointerException
- ifcandidate
isnull
-
memory
public int memory()
Estimates memory footprint of this object. This is a deep estimate, including all nested objects. The estimate should be fairly accurate on all commonly used JVMs.- Returns:
- estimated memory footprint of this object in bytes
-
-