Friction Ridge Image and Features Technology Evaluations
API for participating in NIST's Friction Ridge Image and Features Technology Evaluations.
Loading...
Searching...
No Matches
libfrifte_quality.cpp
Go to the documentation of this file.
1/*
2 * This software was developed at the National Institute of Standards and
3 * Technology (NIST) by employees of the Federal Government in the course
4 * of their official duties. Pursuant to title 17 Section 105 of the
5 * United States Code, this software is not subject to copyright protection
6 * and is in the public domain. NIST assumes no responsibility whatsoever for
7 * its use by other parties, and makes no guarantees, expressed or implied,
8 * about its quality, reliability, or any other characteristic.
9 */
10
11#include <frifte/quality.h>
12
15
16void
23
24void
26 const EFS::QualityMeasure &uqs_)
27{
28 if (!uqs_.hasValue()) {
29 this->uqs = uqs_;
30 return;
31 }
32
33 /* Enforce whole number */
34 if (static_cast<double>(static_cast<int>(uqs_.getValue())) !=
35 uqs_.getValue())
36 throw std::out_of_range{std::to_string(*uqs_) + " "
37 "shall be a whole number [0,100]"};
38
39 /* Enforce [0,100] */
40 if ((*uqs_ < 0) || (*uqs_ > 100))
41 throw std::out_of_range{std::to_string(*uqs_) + " "
42 "shall be a whole number [0,100]"};
43
44 this->uqs = uqs_;
45}
46
53
54void
56 const std::vector<Coordinate> &roi_)
57{
58 this->roi = roi_;
59}
60
61std::optional<std::vector<FRIF::Coordinate>>
63 const
64{
65 return (this->roi);
66}
67
68void
70 const std::vector<FRIF::EFS::RidgeQualityRegion> &rqm_)
71{
72 this->rqm = rqm_;
73}
74
75std::optional<std::vector<FRIF::EFS::RidgeQualityRegion>>
81
82void
84 const Component component,
85 const EFS::QualityMeasure &value)
86{
87 if (!this->components)
88 this->components.emplace();
89
90 if (value.hasValue()) {
91 switch (component) {
93 [[fallthrough]];
95 [[fallthrough]];
97 [[fallthrough]];
99 [[fallthrough]];
101 [[fallthrough]];
103 [[fallthrough]];
105 [[fallthrough]];
107 [[fallthrough]];
109 [[fallthrough]];
111 [[fallthrough]];
113 [[fallthrough]];
115 [[fallthrough]];
117 [[fallthrough]];
119 [[fallthrough]];
121 [[fallthrough]];
123 [[fallthrough]];
125 [[fallthrough]];
127 [[fallthrough]];
129 [[fallthrough]];
131 [[fallthrough]];
133 [[fallthrough]];
135 [[fallthrough]];
137 [[fallthrough]];
139 [[fallthrough]];
141 [[fallthrough]];
143 [[fallthrough]];
145 [[fallthrough]];
147 [[fallthrough]];
149 [[fallthrough]];
151 [[fallthrough]];
153 [[fallthrough]];
155 [[fallthrough]];
157 [[fallthrough]];
159 [[fallthrough]];
161 [[fallthrough]];
163 if ((*value < 0) || (*value > 100) ||
164 (static_cast<double>(
165 static_cast<int>(*value)) != *value))
166 throw std::out_of_range{std::to_string(*value) +
167 " shall be an integer on the range "
168 "[0, 100]"};
169 break;
170
172 [[fallthrough]];
174 if ((*value < 0) || (static_cast<double>(
175 static_cast<int>(*value)) != *value))
176 throw std::out_of_range{std::to_string(*value) +
177 " shall be 0 or a positive integer"};
178 break;
179
181 if ((*value <= 0) || (static_cast<double>(
182 static_cast<int>(*value)) != *value))
183 throw std::out_of_range{std::to_string(*value) +
184 " shall be a positive integer"};
185 break;
186
187 }
188 }
189
190 this->components->insert_or_assign(component, value);
191}
192
193void
195 const Component component)
196{
197 if (!this->components)
198 return;
199
200 this->components->erase(component);
201}
202
203std::optional<std::unordered_map<
206 const
207{
208 return (this->components);
209}
210
Measurement on the biometric sample.
Definition efs.h:1120
bool hasValue() const noexcept
void setROI(const std::vector< Coordinate > &roi)
Define a region of interest of a sample.
void setUnifiedQualityScore(const EFS::QualityMeasure &uqs)
Set the unified quality score or communicate an error about its computation.
std::optional< std::unordered_map< Component, EFS::QualityMeasure > > getComponents() const
std::optional< std::vector< Coordinate > > getROI() const
std::optional< std::vector< EFS::RidgeQualityRegion > > getRidgeQualityMap() const
void removeComponent(const Component component)
Remove a quality component.
EFS::QualityMeasure getUnifiedQualityScore() const
void addComponent(const Component component, const EFS::QualityMeasure &value)
Append a quality component with associated measurement.
void setRidgeQualityMap(const std::vector< EFS::RidgeQualityRegion > &rqm)
Define a series of ridge quality regions.
Component
Quality components.
Definition quality.h:73
@ EvidenceOfFraud
Evidence that impression has been placed by artificial means.
Definition quality.h:267
@ SpottyRidges
Ridges are spotty, regardless of reason.
Definition quality.h:563
@ RidgeValleyUniformity
Consistency between ridge and valley widths.
Definition quality.h:537
@ SpatialSamplingRatePPI
Estimate of pixels per inch resolution of image.
Definition quality.h:550
@ IsolatedRidgeClusters
Significant portion of mark is not connected to other portions.
Definition quality.h:338
@ NumHighConfidenceMinutiae
Number of highly-certain minutiae (i.e., minutiae in high clarity areas).
Definition quality.h:418
@ AnatomicalCluesPresent
Presence of a feature that indicates the anatomical source.
Definition quality.h:100
@ ComplexSubstrate
The substrate (e.g., pattern, texture) makes the impression difficult to interpret.
Definition quality.h:155
@ OpenField
Large area without minutiae.
Definition quality.h:437
@ MultipleOverlappingImpressions
Multiple impressions in ROI that overlap.
Definition quality.h:406
@ DistinctiveClusterPresent
Presence of areas with unique clusters of minutiae.
Definition quality.h:235
@ ExtremeTip
Extreme tips or other regions not typically imaged in an exemplar impression.
Definition quality.h:298
@ EvenPressure
Friction ridges are deposited with an even pressure.
Definition quality.h:253
@ Amputated
Evidence of finger amputation.
Definition quality.h:88
@ Movement
Twists, pulls, slips, and other movement is present.
Definition quality.h:375
@ WetRidges
Ridges that are wet or deposited in a liquid matrix, including blood.
Definition quality.h:584
@ PatternClassification
Pattern classification can be determined.
Definition quality.h:474
@ PatternForceMinutiae
Impression contains mostly pattern force region.
Definition quality.h:490
@ CompressedRidges
Ridges appear wider than normal and potentially overlap, limiting the area of the valleys between.
Definition quality.h:170
@ Level3Present
Pores, incipient ridges, and/or edge shapes are clear.
Definition quality.h:351
@ RidgeColorUncertain
Inability to determine the ridge color in a large portion of the image.
Definition quality.h:504
@ MinutiaePresent
Ridge endings and bifurcations are present or implied.
Definition quality.h:364
@ RidgeFlowContinuity
Orientation differences between a region and its neighbors.
Definition quality.h:515
@ ClearCoreDeltaRidgeCount
Confidence that the computed core-delta ridge count is within two ridges of the true value.
Definition quality.h:130
@ ExcessiveDistortion
Evidence of excessive distortion.
Definition quality.h:284
@ OrientationClue
Information present to help orient the impression.
Definition quality.h:463
@ NumMinutiae
Total number of minutiae discovered.
Definition quality.h:428
@ OrientationCertaintyLevel
Consistency of orientations of ridges within subregions.
Definition quality.h:448
@ DeltaPresent
One or more deltas are present or implied.
Definition quality.h:208
@ FocalPointsPresent
Distinctive features other than cores or deltas are present.
Definition quality.h:312
@ RidgeValleyClarity
Percentage of usable area with good ridge-valley contrast.
Definition quality.h:526
@ Bandaged
Evidence of full or partial bandage.
Definition quality.h:111
@ TonalReversal
Valleys appear darker than ridges.
Definition quality.h:574
@ Condensation
Presence of condensation.
Definition quality.h:183
@ CorePresent
One or more cores are present or implied.
Definition quality.h:197
@ ComplexMatrix
The matrix makes the impression difficult to interpret.
Definition quality.h:141
@ MultipleNonOverlappingImpressions
Multiple impressions in ROI that do not overlap.
Definition quality.h:390
@ Ghosting
Evidence of non-primary impression in image.
Definition quality.h:326
@ DevelopmentArtifacts
Artifacts introduced in development of the impression have caused damage.
Definition quality.h:224