Evaluation of Latent Friction Ridge Technology
API for participating in NIST's evaluation of latent friction ridge identification algorithms.
elft.h
Go to the documentation of this file.
1
33#ifndef ELFT_H_
34#define ELFT_H_
35
36#include <cstddef>
37#include <cstdint>
38#include <filesystem>
39#include <memory>
40#include <optional>
41#include <string>
42#include <tuple>
43#include <vector>
44
45namespace ELFT
46{
48 enum class Impression
49 {
50 PlainContact = 0,
51 RolledContact = 1,
52 Latent = 4,
53 LiveScanSwipe = 8,
56 Other = 28,
57 Unknown = 29,
60 };
61
64 {
65 Unknown = 0,
68 OpticalDirect = 5,
69 Capacitive = 9,
71
73 LatentLift = 22
74 };
75
78 {
79 UnknownFinger = 0,
80 RightThumb = 1,
81 RightIndex = 2,
82 RightMiddle = 3,
83 RightRing = 4,
84 RightLittle = 5,
85 LeftThumb = 6,
86 LeftIndex = 7,
87 LeftMiddle = 8,
88 LeftRing = 9,
89 LeftLittle = 10,
90 RightExtraDigit = 16,
91 LeftExtraDigit = 17,
92
93 RightFour = 13,
94 LeftFour = 14,
96
97 UnknownPalm = 20,
98 RightFullPalm = 21,
100 LeftFullPalm = 23,
101 LeftWritersPalm = 24,
102 RightLowerPalm = 25,
103 RightUpperPalm = 26,
104 LeftLowerPalm = 27,
105 LeftUpperPalm = 28,
106 RightPalmOther = 29,
107 LeftPalmOther = 30,
109 RightThenar = 32,
110 RightHypothenar = 33,
111 LeftInterdigital = 34,
112 LeftThenar = 35,
113 LeftHypothenar = 36,
114 RightGrasp = 37,
115 LeftGrasp = 38,
122
124 EJIOrTip = 19
125 };
126
129 {
132 Other,
134 Laser,
135 RUVIS,
137 Visual,
139 };
140
149 {
150 Arch,
151 Whorl,
152 RightLoop,
153 LeftLoop,
157 Scar,
159 };
160
163 {
164 Value,
165 Limited,
166 NoValue
167 };
168
170 enum class Substrate
171 {
172 Paper,
174
175 Plastic,
176 Glass,
181
184
185 Other,
186 Unknown
187 };
188
191 {
193 enum class Result
194 {
196 Success = 0,
198 Failure
199 };
200
207 std::optional<std::string> message{};
208
213 explicit operator bool()
214 const
215 noexcept;
216 };
217
219 struct Image
220 {
222
253 Image(
254 const uint8_t identifier,
255 const uint16_t width,
256 const uint16_t height,
257 const uint16_t ppi,
258 const uint8_t bpc,
259 const uint8_t bpp,
260 const std::vector<std::byte> &pixels);
261
266 uint8_t identifier{};
268 uint16_t width{};
270 uint16_t height{};
272 uint16_t ppi{};
274 uint8_t bpc{};
279 uint8_t bpp{};
297 std::vector<std::byte> pixels{};
298 };
299
302 {
304 uint32_t x{};
306 uint32_t y{};
307
318 const uint32_t x = {},
319 const uint32_t y = {});
320
321 bool
322 operator==(
323 const Coordinate &rhs)
324 const;
325
326 bool
327 operator!=(
328 const Coordinate &rhs)
329 const;
330
331 bool
332 operator<(
333 const Coordinate &rhs)
334 const;
335
336 bool
337 operator<=(
338 const Coordinate &rhs)
339 const;
340
341 bool
342 operator>(
343 const Coordinate &rhs)
344 const;
345
346 bool
347 operator>=(
348 const Coordinate &rhs)
349 const;
350 };
351
353 enum class MinutiaType
354 {
357 Other,
358 Unknown
359 };
360
362 struct Minutia
363 {
365 Coordinate coordinate{};
370 uint16_t theta{};
373
386 Minutia(
387 const Coordinate &coordinate = {},
388 const uint16_t theta = {},
389 const MinutiaType type = MinutiaType::Unknown);
390 };
391
393 struct Core
394 {
396 Coordinate coordinate{};
402 std::optional<uint16_t> direction{};
403
415 Core(
416 const Coordinate &coordinate = {},
417 const std::optional<uint16_t> &direction = {});
418 };
419
421 struct Delta
422 {
424 Coordinate coordinate{};
431 std::optional<std::tuple<std::optional<uint16_t>,
432 std::optional<uint16_t>, std::optional<uint16_t>>>
433 direction{};
434
446 Delta(
447 const Coordinate &coordinate = {},
448 const std::optional<std::tuple<std::optional<uint16_t>,
449 std::optional<uint16_t>, std::optional<uint16_t>>>
450 &direction = {});
451 };
452
461 {
463 Definite,
465 Possible,
488 };
489
492 {
495
504 std::string probeIdentifier{};
506 uint8_t probeInputIdentifier{};
508 Minutia probeMinutia{};
509
518 std::string referenceIdentifier{};
523 uint8_t referenceInputIdentifier{};
529 Minutia referenceMinutia{};
530
552 const CorrespondenceType type = {},
553 const std::string &probeIdentifier = {},
554 const uint8_t probeInputIdentifier = {},
555 const Minutia &probeMinutia = {},
556 const std::string &referenceIdentifier = {},
557 const uint8_t referenceInputIdentifier = {},
558 const Minutia &referenceMinutia = {});
559 };
560
563 {
565 struct Data
566 {
568 std::vector<std::vector<Correspondence>>
569 correspondence{};
570
580 std::optional<bool> complex{};
581
582 };
583
585 ReturnStatus status{};
587 Data data{};
588 };
589
591 enum class RidgeQuality
592 {
594 Background = 0,
614 };
615
618 {
629 std::vector<Coordinate> region{};
632 };
633
642 struct EFS
643 {
648 uint8_t identifier{};
649
654 uint16_t ppi{};
655
664
669 std::optional<int16_t> orientation{};
671 std::optional<std::vector<ProcessingMethod>> lpm{};
673 std::optional<ValueAssessment> valueAssessment{};
675 std::optional<Substrate> lsb{};
677 std::optional<PatternClassification> pat{};
678
682 std::optional<bool> plr{};
687 std::optional<bool> trv{};
688
699 std::optional<std::vector<Core>> cores{};
710 std::optional<std::vector<Delta>> deltas{};
726 std::optional<std::vector<Minutia>> minutiae{};
738 std::optional<std::vector<Coordinate>> roi{};
739
754 std::optional<std::vector<RidgeQualityRegion>> rqm{};
755
765 std::optional<bool> complex{};
766 };
767
777 {
782 std::string candidateIdentifier{};
783
785 uint8_t inputIdentifier{};
786
788 std::optional<EFS> efs{};
789
791 std::optional<uint8_t> imageQuality{};
792 };
793
796 {
798 ReturnStatus status{};
800 std::vector<std::byte> data{};
801
825 std::optional<std::vector<TemplateData>> extractedData{};
826 };
827
830 {
832 std::string identifier{};
836 double similarity{};
837
849 Candidate(
850 const std::string &identifier = {},
851 const FrictionRidgeGeneralizedPosition frgp = {},
852 const double similarity = {});
853
854 bool
855 operator==(
856 const Candidate &rhs)
857 const;
858
859 bool
860 operator!=(
861 const Candidate &rhs)
862 const;
863
864 bool
865 operator<(
866 const Candidate &rhs)
867 const;
868
869 bool
870 operator<=(
871 const Candidate &rhs)
872 const;
873
874 bool
875 operator>(
876 const Candidate &rhs)
877 const;
878
879 bool
880 operator>=(
881 const Candidate &rhs)
882 const;
883 };
884
887 {
892 ReturnStatus status{};
896 bool decision{};
905 std::vector<Candidate> candidateList{};
906
931 std::optional<CorrespondenceResult::Data> correspondence{};
932 };
933
935 enum class TemplateType
936 {
938 Probe,
941 };
942
945 {
947 std::filesystem::path archive{};
966 std::filesystem::path manifest{};
967 };
968
971 {
974 {
976 uint16_t owner{};
978 std::optional<uint16_t> algorithm{};
979 };
980
985 std::optional<std::string> marketing{};
987 std::optional<CBEFFIdentifier> cbeff{};
988 };
989
992 {
993 public:
999 {
1001
1028 const uint16_t versionNumber,
1029 const std::string &libraryIdentifier,
1030 const std::optional<ProductIdentifier>
1031 &exemplarAlgorithmIdentifier = {},
1032 const std::optional<ProductIdentifier>
1033 &latentAlgorithmIdentifier = {});
1034
1039 uint16_t versionNumber{};
1046 std::string libraryIdentifier{};
1047
1052 std::optional<ProductIdentifier>
1053 exemplarAlgorithmIdentifier{};
1058 std::optional<ProductIdentifier>
1059 latentAlgorithmIdentifier{};
1060 };
1061
1074 virtual
1075 SubmissionIdentification
1077 const = 0;
1078
1127 virtual
1130 const TemplateType templateType,
1131 const std::string &identifier,
1132 const std::vector<std::tuple<
1133 std::optional<Image>, std::optional<EFS>>> &samples)
1134 const = 0;
1135
1174 virtual
1175 std::optional<std::tuple<ReturnStatus,
1176 std::vector<TemplateData>>>
1178 const TemplateType templateType,
1179 const CreateTemplateResult &templateResult)
1180 const = 0;
1181
1215 virtual
1218 const TemplateArchive &referenceTemplates,
1219 const std::filesystem::path &databaseDirectory,
1220 const uint64_t maxSize)
1221 const = 0;
1222
1223 /**************************************************************/
1224
1247 static
1248 std::shared_ptr<ExtractionInterface>
1250 const std::filesystem::path &configurationDirectory);
1251
1256 ExtractionInterface& operator=(const ExtractionInterface&) =
1257 delete;
1262 };
1263
1266 {
1267 public:
1285 virtual
1286 std::optional<ProductIdentifier>
1288 const = 0;
1289
1347 virtual
1350 const uint64_t maxSize) = 0;
1351
1352 /**************************************************************/
1353
1400 virtual
1403 const std::vector<std::byte> &probeTemplate,
1404 const uint16_t maxCandidates)
1405 const = 0;
1406
1447 virtual
1448 std::optional<CorrespondenceResult>
1450 const std::vector<std::byte> &probeTemplate,
1451 const SearchResult &searchResult)
1452 const = 0;
1453
1454 /**************************************************************/
1455
1492 static
1493 std::shared_ptr<SearchInterface>
1495 const std::filesystem::path &configurationDirectory,
1496 const std::filesystem::path &databaseDirectory);
1497
1500 SearchInterface(const SearchInterface&) = delete;
1502 SearchInterface& operator=(const SearchInterface&) = delete;
1507 };
1508
1509 /*
1510 * API versioning.
1511 *
1512 * NIST code will extern the version number symbols. Participant code
1513 * shall compile them into their core library.
1514 */
1515 #ifdef NIST_EXTERN_API_VERSION
1517 extern uint16_t API_MAJOR_VERSION;
1519 extern uint16_t API_MINOR_VERSION;
1521 extern uint16_t API_PATCH_VERSION;
1522 #else /* NIST_EXTERN_API_VERSION */
1529 #endif /* NIST_EXTERN_API_VERSION */
1530
1531 /*
1532 * Ensure that std::byte is exactly 8 bits, such that reinterpret_casts
1533 * may be safely used.
1534 */
1535 static_assert(std::is_same_v<std::underlying_type_t<std::byte>,
1536 uint8_t>, "std::byte not represented as unsigned 8 bit type");
1537}
1538
1539#endif /* ELFT_H_ */
Interface for feature extraction implemented by participant.
Definition: elft.h:992
virtual CreateTemplateResult createTemplate(const TemplateType templateType, const std::string &identifier, const std::vector< std::tuple< std::optional< Image >, std::optional< EFS > > > &samples) const =0
Extract features from one or more images and encode them into a template.
static std::shared_ptr< ExtractionInterface > getImplementation(const std::filesystem::path &configurationDirectory)
Obtain a managed pointer to an object implementing ExtractionInterface.
virtual std::optional< std::tuple< ReturnStatus, std::vector< TemplateData > > > extractTemplateData(const TemplateType templateType, const CreateTemplateResult &templateResult) const =0
Extract information contained within a template.
virtual ReturnStatus createReferenceDatabase(const TemplateArchive &referenceTemplates, const std::filesystem::path &databaseDirectory, const uint64_t maxSize) const =0
Create a reference database on the filesystem.
virtual SubmissionIdentification getIdentification() const =0
Obtain identification and version information for the extraction portion of this submission.
Interface for database search implemented by participant.
Definition: elft.h:1266
virtual std::optional< ProductIdentifier > getIdentification() const =0
Obtain identification and version information for the search portion of this submission.
virtual std::optional< CorrespondenceResult > extractCorrespondence(const std::vector< std::byte > &probeTemplate, const SearchResult &searchResult) const =0
Extract pairs of corresponding Minutia between TemplateType::Probe and TemplateType::Reference templa...
virtual ~SearchInterface()
virtual ReturnStatus load(const uint64_t maxSize)=0
Load reference database into memory.
static std::shared_ptr< SearchInterface > getImplementation(const std::filesystem::path &configurationDirectory, const std::filesystem::path &databaseDirectory)
Obtain a managed pointer to an object implementing SearchInterface.
virtual SearchResult search(const std::vector< std::byte > &probeTemplate, const uint16_t maxCandidates) const =0
Search the reference database for the samples represented in probeTemplate.
Definition: elft.h:46
RidgeQuality
Local ridge quality codes from ANSI/NIST-ITL 1-2011 (2015).
Definition: elft.h:592
@ DebatableMinutiae
Continuity of ridge flow is certain; minutiae are debatable.
@ DebatableRidgeFlow
Continuity of ridge flow is uncertain.
@ DefinitiveRidgeEdges
Ridge edges, minutiae, and ridge flow are obvious and unambiguous; pores are either debatable or not ...
@ DefinitivePores
Pores and ridge edges are obvious and unambiguous.
@ Background
No ridge information.
@ DefinitiveMinutiae
Minutiae and ridge flow are obvious and unambiguous; ridge edges are debatable.
Substrate
EFS substrate codes from ANSI/NIST-ITL 1-2011 (2015).
Definition: elft.h:171
MinutiaType
Types of minutiae.
Definition: elft.h:354
ValueAssessment
EFS value assessment codes from ANSI/NIST-ITL 1-2011 (2015).
Definition: elft.h:163
FrictionRidgeCaptureTechnology
Capture device codes from ANSI/NIST-ITL 1-2011 (2015).
Definition: elft.h:64
Impression
Friction ridge impression types from ANSI/NIST-ITL 1-2011 (2015).
Definition: elft.h:49
FrictionRidgeGeneralizedPosition
Friction positions codes from ANSI/NIST-ITL 1-2011 (2015).
Definition: elft.h:78
uint16_t API_PATCH_VERSION
API patch version number.
Definition: elft.h:1528
ProcessingMethod
EFS processing method codes from ANSI/NIST-ITL 1-2011 (2015).
Definition: elft.h:129
uint16_t API_MINOR_VERSION
API minor version number.
Definition: elft.h:1526
uint16_t API_MAJOR_VERSION
API major version number.
Definition: elft.h:1524
TemplateType
Types of templates created by this interface.
Definition: elft.h:936
@ Reference
Template to be added to a reference database.
@ Probe
Template to be used as probe in a search.
PatternClassification
Classification of friction ridge structure.
Definition: elft.h:149
CorrespondenceType
Types of correspondence.
Definition: elft.h:461
@ Definite
Probe feature definitely corresponds.
@ OutOfRegion
Probe feature lies outside the reference.
@ Possible
Probe feature possibly/debatably corresponds.
@ DoesNotExist
Probe feature definitely does not exist.
@ UnclearArea
Probe feature lies in an area experiencing quality issues in the reference.
Elements of a candidate list.
Definition: elft.h:830
Pixel location in an image.
Definition: elft.h:302
Singular point of focus of innermost recurving ridge.
Definition: elft.h:394
Relationship between probe and reference features.
Definition: elft.h:492
Information about a probe/reference relationship.
Definition: elft.h:566
Output from extracting data from a search.
Definition: elft.h:563
Output from extracting features into a template .
Definition: elft.h:796
Singular point of ridge divergence.
Definition: elft.h:422
Collection of ANSI/NIST-ITL 1-2011 (Update: 2015) Extended Feature Set fields understood by ELFT.
Definition: elft.h:643
Identifying information about this submission that will be included in reports.
Definition: elft.h:999
Data and metadata for an image.
Definition: elft.h:220
Friction ridge feature details.
Definition: elft.h:363
CBEFF information registered with and assigned by IBIA.
Definition: elft.h:974
Identifying details about algorithm components for documentation.
Definition: elft.h:971
Information about the result of calling an ELFT API function.
Definition: elft.h:191
std::optional< std::string > message
Information about the result.
Definition: elft.h:207
Result result
The result of the operation.
Definition: elft.h:202
Result
Possible outcomes when performing operations.
Definition: elft.h:194
Region defined in a map of ridge quality/confidence.
Definition: elft.h:618
The results of a searching a database.
Definition: elft.h:887
Collection of templates on disk.
Definition: elft.h:945
Information possibly stored in a template.
Definition: elft.h:777