Proprietary Fingerprint Template III
API for participating in NIST's evaluation of proprietary fingerprint template algorithms.
pftiii.h
1
33#ifndef PFTIII_H_
34#define PFTIII_H_
35
36#include <cstddef>
37#include <filesystem>
38#include <memory>
39#include <string>
40#include <tuple>
41#include <vector>
42
44namespace PFTIII
45{
47 enum class Impression
48 {
49 PlainContact = 0,
50 RolledContact = 1,
51 LiveScanSwipe = 8,
52 PlainContactlessStationary = 24,
53 RolledContactlessStationary = 25,
54 Unknown = 29,
55 RolledContactlessMoving = 41,
56 PlainContactlessMoving = 42
57 };
58
61 {
62 Unknown = 0,
63 ScannedInkOnPaper = 2,
64 OpticalTIRBright = 3,
65 OpticalDirect = 5,
66 Capacitive = 9,
67 Electroluminescent = 11,
68 };
69
72 {
73 Unknown = 0,
74 RightThumb = 1,
75 RightIndex = 2,
76 RightMiddle = 3,
77 RightRing = 4,
78 RightLittle = 5,
79 LeftThumb = 6,
80 LeftIndex = 7,
81 LeftMiddle = 8,
82 LeftRing = 9,
83 LeftLittle = 10,
84 RightExtraDigit = 16,
85 LeftExtraDigit = 17
86 };
87
90 {
93
118 const uint16_t width,
119 const uint16_t height,
120 const uint16_t ppi,
121 const std::vector<std::byte> &pixels,
122 const Impression imp = Impression::Unknown,
124 FrictionRidgeCaptureTechnology::Unknown,
126 FrictionRidgeGeneralizedPosition::Unknown);
127
129 uint16_t width{};
131 uint16_t height{};
133 uint16_t ppi{};
149 std::vector<std::byte> pixels{};
151 Impression imp{Impression::Unknown};
154 FrictionRidgeCaptureTechnology::Unknown};
157 FrictionRidgeGeneralizedPosition::Unknown};
158 };
159
162 {
168 enum class Code
169 {
171 Supported = 0,
173 InvalidImageData,
175 VendorDefined
176 };
177
188 const Code code = Code::Supported,
189 const std::string &message = "");
190
194 std::string message{};
195 };
196
198 enum class Result
199 {
201 Success = 0,
203 Failure
204 };
205
208 {
222 success(
223 const std::vector<std::byte> &proprietaryTemplate,
224 const std::string &message = "");
225
237 failure(
238 const std::string &message = "");
239
243 std::vector<std::byte> proprietaryTemplate{};
245 std::string message{};
246 };
247
250 {
262 const std::string &message = "");
263
273 success();
274
286 failure(
287 const std::string &message = "");
288
292 std::string message{};
293 };
294
300 {
303
352 const uint16_t versionNumber,
353 const std::string &libraryIdentifier,
354 const std::tuple<std::string, bool>
356 std::make_tuple("", false),
357 const std::tuple<std::string, bool>
359 std::make_tuple("", false),
360 const std::tuple<uint16_t, bool>
362 std::make_tuple(0x0000, false),
363 const std::tuple<uint16_t, bool>
365 std::make_tuple(0x0000, false),
366 const std::tuple<uint16_t, bool>
367 &cbeffComparisoinAlgorithmProductOwner =
368 std::make_tuple(0x0000, false),
369 const std::tuple<uint16_t, bool>
371 std::make_tuple(0x0000, false));
372
377 uint16_t versionNumber{};
383 std::string libraryIdentifier{};
391 std::tuple<std::string, bool>
400 std::tuple<std::string, bool>
402
403 /*
404 * CBEFF information, if registered.
405 */
406
416 std::tuple<uint16_t, bool>
426 std::tuple<uint16_t, bool>
428
438 std::tuple<uint16_t, bool>
448 std::tuple<uint16_t, bool> cbeffComparisonAlgorithmIdentifier{
449 0x0000, false};
450 };
451
454 {
455 public:
468 virtual
471 const = 0;
472
524 virtual
525 std::tuple<FingerImageStatus, CreateProprietaryTemplateResult>
527 const FingerImage &fingerImage) = 0;
528
570 virtual
571 std::tuple<CompareProprietaryTemplatesStatus, double>
573 const std::vector<std::byte> &probeTemplate,
574 const std::vector<std::byte> &referenceTemplate) = 0;
575
577 virtual ~Interface();
578
604 static
605 std::shared_ptr<Interface>
607 const std::filesystem::path &configurationDirectory);
608
611 Interface(const Interface&) = delete;
613 Interface& operator=(const Interface&) = delete;
616 Interface();
617 };
618
619 /*
620 * API versioning.
621 *
622 * NIST code will extern the version number symbols. Participant code
623 * shall compile them into their core library.
624 */
625 #ifdef NIST_EXTERN_API_VERSION
627 extern uint16_t API_MAJOR_VERSION;
629 extern uint16_t API_MINOR_VERSION;
631 extern uint16_t API_PATCH_VERSION;
632 #else /* NIST_EXTERN_API_VERSION */
634 uint16_t API_MAJOR_VERSION{1};
636 uint16_t API_MINOR_VERSION{1};
638 uint16_t API_PATCH_VERSION{0};
639 #endif /* NIST_EXTERN_API_VERSION */
640
641 /*
642 * Ensure that std::byte is exactly 8 bits, such that reinterpret_casts
643 * may be safely used.
644 */
645 static_assert(std::is_same_v<std::underlying_type_t<std::byte>,
646 uint8_t>, "std::byte not represented as unsigned 8 bit type");
647}
648
649#endif /* PFTIII_H_ */
PFT III Interface.
Definition: pftiii.h:454
static std::shared_ptr< Interface > getImplementation(const std::filesystem::path &configurationDirectory)
Obtain a managed pointer to an object implementing PFTIII::Interface.
virtual std::tuple< FingerImageStatus, CreateProprietaryTemplateResult > createProprietaryTemplate(const FingerImage &fingerImage)=0
Create a proprietary biometric template from a fingerprint image.
virtual SubmissionIdentification getIdentification() const =0
Obtain identification and version information for this submission.
Interface()
Default constructor.
Definition: libpftiii.cpp:147
virtual ~Interface()
Destructor.
Definition: libpftiii.cpp:152
virtual std::tuple< CompareProprietaryTemplatesStatus, double > compareProprietaryTemplates(const std::vector< std::byte > &probeTemplate, const std::vector< std::byte > &referenceTemplate)=0
Perform a one-to-one comparison of proprietary templates.
Proprietary Fingerprint Template Evaluation III namespace.
Definition: pftiii.h:45
FrictionRidgeGeneralizedPosition
Friction positions codes from ANSI/NIST-ITL 1-2011 (2015).
Definition: pftiii.h:72
uint16_t API_MAJOR_VERSION
API major version number.
Definition: pftiii.h:634
uint16_t API_PATCH_VERSION
API patch version number.
Definition: pftiii.h:638
Result
Possible outcomes when performing operations.
Definition: pftiii.h:199
@ Success
Successfully performed operation.
@ Failure
Failed to perform operation.
FrictionRidgeCaptureTechnology
Capture device codes from ANSI/NIST-ITL 1-2011 (2015).
Definition: pftiii.h:61
Impression
Friction ridge impression types from ANSI/NIST-ITL 1-2011 (2015).
Definition: pftiii.h:48
uint16_t API_MINOR_VERSION
API minor version number.
Definition: pftiii.h:636
Information about the execution of template comparison.
Definition: pftiii.h:250
CompareProprietaryTemplatesStatus(const Result result=Result::Success, const std::string &message="")
CompareProprietaryTemplatesStatus constructor.
Definition: libpftiii.cpp:113
static CompareProprietaryTemplatesStatus failure(const std::string &message="")
Convenience method for comparison failures.
Definition: libpftiii.cpp:123
Result result
Outcome of comparing two proprietary templates.
Definition: pftiii.h:290
static CompareProprietaryTemplatesStatus success()
Convenience method for comparison success.
Definition: libpftiii.cpp:135
std::string message
Explanatory message (optional).
Definition: pftiii.h:292
Output from extracting features into a proprietary template .
Definition: pftiii.h:208
static CreateProprietaryTemplateResult success(const std::vector< std::byte > &proprietaryTemplate, const std::string &message="")
Convenience method for creation success.
Definition: libpftiii.cpp:53
Result result
Result of extracting features and creating a template.
Definition: pftiii.h:241
std::vector< std::byte > proprietaryTemplate
Contents of the proprietary template.
Definition: pftiii.h:243
static CreateProprietaryTemplateResult failure(const std::string &message="")
Convenience method for creation failures.
Definition: libpftiii.cpp:40
std::string message
Explanatory message (optional).
Definition: pftiii.h:245
Data and metadata for an image containing a single fingerprint.
Definition: pftiii.h:90
FingerImage()
Default constructor.
Definition: libpftiii.cpp:13
uint16_t ppi
Resolution of the image in pixels per inch.
Definition: pftiii.h:133
FrictionRidgeCaptureTechnology frct
Capture technology that created this image.
Definition: pftiii.h:153
std::vector< std::byte > pixels
Raw pixel data of image.
Definition: pftiii.h:149
Impression imp
Impression type of the depicted finger.
Definition: pftiii.h:151
FrictionRidgeGeneralizedPosition frgp
Position of the depicted finger.
Definition: pftiii.h:156
uint16_t width
Width of the image.
Definition: pftiii.h:129
uint16_t height
Height of the image.
Definition: pftiii.h:131
Information about whether a FingerImage is supported.
Definition: pftiii.h:162
Code code
Indication of if a FingerImage is supported.
Definition: pftiii.h:192
FingerImageStatus(const Code code=Code::Supported, const std::string &message="")
FingerImageStatus constructor.
Definition: libpftiii.cpp:102
Code
Possible scenarios affecting input image data that could cause createProprietaryTemplates() to fail b...
Definition: pftiii.h:169
@ Supported
Image is supported.
std::string message
Explanatory message.
Definition: pftiii.h:194
Identifying information about this submission that will be included in reports.
Definition: pftiii.h:300
std::tuple< std::string, bool > featureExtractionAlgorithmMarketingIdentifier
Non-infringing marketing name of the feature extraction algorithm included in this submission.
Definition: pftiii.h:392
std::string libraryIdentifier
Non-infringing identifier of this submission.
Definition: pftiii.h:383
std::tuple< uint16_t, bool > cbeffFeatureExtractionAlgorithmProductOwner
CBEFF Product Owner of the feature extraction algorithm, if registered.
Definition: pftiii.h:417
std::tuple< uint16_t, bool > cbeffComparisonAlgorithmProductOwner
CBEFF Product Owner of the template comparison algorithm, if registered.
Definition: pftiii.h:439
std::tuple< uint16_t, bool > cbeffComparisonAlgorithmIdentifier
CBEFF Comparison Algorithm Identifier, if registered.
Definition: pftiii.h:448
std::tuple< uint16_t, bool > cbeffFeatureExtractionAlgorithmIdentifier
CBEFF Feature Extraction Algorithm Identifier, if registered.
Definition: pftiii.h:427
uint16_t versionNumber
Version number of this submission.
Definition: pftiii.h:377
std::tuple< std::string, bool > comparisonAlgorithmMarketingIdentifier
Non-infringing marketing name of the comparison algorithm included in this submission.
Definition: pftiii.h:401
SubmissionIdentification()
Default constructor.
Definition: libpftiii.cpp:68