Evaluation of Latent Friction Ridge Technology
API for participating in NIST's evaluation of latent friction ridge identification algorithms.
libelft.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 <elft.h>
12
15
19 const uint16_t versionNumber,
20 const std::string &libraryIdentifier,
21 const std::optional<ProductIdentifier> &exemplarAlgorithmIdentifier,
22 const std::optional<ProductIdentifier> &latentAlgorithmIdentifier) :
23 versionNumber{versionNumber},
24 libraryIdentifier{libraryIdentifier},
25 exemplarAlgorithmIdentifier{exemplarAlgorithmIdentifier},
26 latentAlgorithmIdentifier{latentAlgorithmIdentifier}
27{
28
29}
30
33
34ELFT::Image::Image() = default;
36 const uint8_t identifier,
37 const uint16_t width,
38 const uint16_t height,
39 const uint16_t ppi,
40 const uint8_t bpc,
41 const uint8_t bpp,
42 const std::vector<std::byte> &pixels) :
43 identifier{identifier},
44 width{width},
45 height{height},
46 ppi{ppi},
47 bpc{bpc},
48 bpp{bpp},
49 pixels{pixels}
50{
51
52}
53
54ELFT::ReturnStatus::operator bool()
55 const
56 noexcept
57{
58 return (this->result == Result::Success);
59}
60
61
63 const std::string &identifier,
65 const double similarity) :
66 identifier{identifier},
67 frgp{frgp},
68 similarity{similarity}
69{
70
71}
72
73bool
75 const Candidate &rhs)
76 const
77{
78 return ((this->similarity == rhs.similarity) &&
79 (this->identifier == rhs.identifier) &&
80 (this->frgp == rhs.frgp));
81}
82
83bool
85 const Candidate &rhs)
86 const
87{
88 return (!(*this == rhs));
89}
90
91bool
93 const Candidate &rhs)
94 const
95{
96 if (this->similarity < rhs.similarity)
97 return (true);
98 if (this->similarity > rhs.similarity)
99 return (false);
100
101 if (this->identifier < rhs.identifier)
102 return (true);
103 if (this->identifier > rhs.identifier)
104 return (false);
105
106 if (this->frgp < rhs.frgp)
107 return (true);
108 if (this->frgp > rhs.frgp)
109 return (false);
110
111 return (false);
112
113}
114
115bool
117 const Candidate &rhs)
118 const
119{
120 return ((*this < rhs) || (*this == rhs));
121}
122
123bool
125 const Candidate &rhs)
126 const
127{
128 return (!(*this <= rhs));
129}
130
131bool
133 const Candidate &rhs)
134 const
135{
136 return ((*this > rhs) || (*this == rhs));
137}
138
140 const uint32_t x,
141 const uint32_t y) :
142 x{x},
143 y{y}
144{
145
146}
147
148bool
150 const Coordinate &rhs)
151 const
152{
153 return ((this->x == rhs.x) && (this->y == rhs.y));
154}
155
156bool
158 const Coordinate &rhs)
159 const
160{
161 return (!(*this == rhs));
162}
163
164bool
166 const Coordinate &rhs)
167 const
168{
169 /* Ascending X */
170 if (this->x > rhs.x)
171 return (false);
172 if (this->x < rhs.x)
173 return (true);
174
175 /* Ascending Y */
176 if (this->y > rhs.y)
177 return (false);
178 if (this->y < rhs.y)
179 return (true);
180
181 /* Equivalent */
182 return (false);
183}
184
185bool
187 const Coordinate &rhs)
188 const
189{
190 return ((*this < rhs) || (*this == rhs));
191}
192
193bool
195 const Coordinate &rhs)
196 const
197{
198 return (!(*this <= rhs));
199}
200
201bool
203 const Coordinate &rhs)
204 const
205{
206 return ((*this > rhs) || (*this == rhs));
207}
208
211 const std::string &probeIdentifier,
212 const uint8_t probeInputIdentifier,
213 const Minutia &probeMinutia,
214 const std::string &referenceIdentifier,
215 const uint8_t referenceInputIdentifier,
216 const Minutia &referenceMinutia) :
217 type{type},
218 probeIdentifier{probeIdentifier},
219 probeInputIdentifier{probeInputIdentifier},
220 probeMinutia{probeMinutia},
221 referenceIdentifier{referenceIdentifier},
222 referenceInputIdentifier{referenceInputIdentifier},
223 referenceMinutia{referenceMinutia}
224{
225
226}
227
229 const Coordinate &coordinate,
230 const uint16_t theta,
231 const MinutiaType type) :
232 coordinate{coordinate},
233 theta{theta},
234 type{type}
235{
236
237}
238
240 const Coordinate &coordinate,
241 const std::optional<uint16_t> &direction) :
242 coordinate{coordinate},
243 direction{direction}
244{
245
246}
247
249 const Coordinate &coordinate,
250 const std::optional<std::tuple<std::optional<uint16_t>,
251 std::optional<uint16_t>, std::optional<uint16_t>>> &direction) :
252 coordinate{coordinate},
253 direction{direction}
254{
255
256}
virtual ~SearchInterface()
MinutiaType
Types of minutiae.
Definition: elft.h:354
FrictionRidgeGeneralizedPosition
Friction positions codes from ANSI/NIST-ITL 1-2011 (2015).
Definition: elft.h:78
CorrespondenceType
Types of correspondence.
Definition: elft.h:461
Elements of a candidate list.
Definition: elft.h:830
bool operator!=(const Candidate &rhs) const
Definition: libelft.cpp:84
std::string identifier
Identifier of the sample in the reference database.
Definition: elft.h:832
FrictionRidgeGeneralizedPosition frgp
Most localized position in the identifier.
Definition: elft.h:834
bool operator<(const Candidate &rhs) const
Definition: libelft.cpp:92
bool operator>(const Candidate &rhs) const
Definition: libelft.cpp:124
bool operator>=(const Candidate &rhs) const
Definition: libelft.cpp:132
bool operator==(const Candidate &rhs) const
Definition: libelft.cpp:74
bool operator<=(const Candidate &rhs) const
Definition: libelft.cpp:116
Candidate(const std::string &identifier={}, const FrictionRidgeGeneralizedPosition frgp={}, const double similarity={})
Candidate constructor.
Definition: libelft.cpp:62
double similarity
Quantification of probe's similarity to reference sample.
Definition: elft.h:836
Pixel location in an image.
Definition: elft.h:302
bool operator<=(const Coordinate &rhs) const
Definition: libelft.cpp:186
bool operator>(const Coordinate &rhs) const
Definition: libelft.cpp:194
bool operator!=(const Coordinate &rhs) const
Definition: libelft.cpp:157
bool operator==(const Coordinate &rhs) const
Definition: libelft.cpp:149
uint32_t y
Y coordinate in pixels.
Definition: elft.h:306
bool operator>=(const Coordinate &rhs) const
Definition: libelft.cpp:202
uint32_t x
X coordinate in pixels.
Definition: elft.h:304
Coordinate(const uint32_t x={}, const uint32_t y={})
Coordinate constructor.
Definition: libelft.cpp:139
bool operator<(const Coordinate &rhs) const
Definition: libelft.cpp:165
Core(const Coordinate &coordinate={}, const std::optional< uint16_t > &direction={})
Core constructor.
Definition: libelft.cpp:239
Correspondence(const CorrespondenceType type={}, const std::string &probeIdentifier={}, const uint8_t probeInputIdentifier={}, const Minutia &probeMinutia={}, const std::string &referenceIdentifier={}, const uint8_t referenceInputIdentifier={}, const Minutia &referenceMinutia={})
Correspondence constructor.
Definition: libelft.cpp:209
Delta(const Coordinate &coordinate={}, const std::optional< std::tuple< std::optional< uint16_t >, std::optional< uint16_t >, std::optional< uint16_t > > > &direction={})
Delta constructor.
Definition: libelft.cpp:248
Friction ridge feature details.
Definition: elft.h:363
Minutia(const Coordinate &coordinate={}, const uint16_t theta={}, const MinutiaType type=MinutiaType::Unknown)
Minutia constructor.
Definition: libelft.cpp:228