Friction Ridge Image and Features Technology Evaluations
API for participating in NIST's Friction Ridge Image and Features Technology Evaluations.
Loading...
Searching...
No Matches
e1n.h
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
49
50#ifndef FRIF_EVALUATIONS_E1N_H_
51#define FRIF_EVALUATIONS_E1N_H_
52
53#include <cstddef>
54#include <cstdint>
55#include <filesystem>
56#include <memory>
57#include <optional>
58#include <set>
59#include <string>
60#include <tuple>
61#include <vector>
62
63#include <frifte/frifte.h>
64
67{
71
74 {
75 public:
81 {
87
93
106 std::set<uint16_t> probeTemplateVersions{};
107
120 std::set<uint16_t> referenceTemplateVersions{};
121
134 std::set<uint16_t> referenceDatabaseVersions{};
135 };
136
196 virtual
197 std::tuple<ReturnStatus, std::optional<CreateTemplateResult>>
199 const TemplateType templateType,
200 const std::string &identifier,
201 const std::vector<Sample> &samples)
202 const = 0;
203
249 virtual
250 std::optional<std::tuple<ReturnStatus,
251 std::vector<TemplateData>>>
253 const TemplateType templateType,
254 const CreateTemplateResult &templateResult)
255 const = 0;
256
303 virtual
306 const TemplateArchive &referenceTemplates,
307 const std::filesystem::path &databaseDirectory,
308 const uint64_t maxSize)
309 const = 0;
310
311 /**************************************************************/
312
340 static
341 std::shared_ptr<ExtractionInterface>
343 const std::filesystem::path &configurationDirectory);
344
360 static
361 std::optional<ProductIdentifier>
363
379 static
382
387 ExtractionInterface& operator=(const ExtractionInterface&) =
388 delete;
390
393 };
394
397 {
398 public:
404 {
410
423 std::set<uint16_t> probeTemplateVersions{};
424
437 std::set<uint16_t> referenceDatabaseVersions{};
438 };
439
501 virtual
504 const uint64_t maxSize) = 0;
505
506 /**************************************************************/
507
569 virtual
570 std::tuple<ReturnStatus,
571 std::optional<SearchSubjectPositionResult>>
573 const std::vector<std::byte> &probeTemplate,
574 const uint16_t maxCandidates)
575 const = 0;
576
626 virtual
627 std::tuple<ReturnStatus, std::optional<SearchSubjectResult>>
629 const std::vector<std::byte> &probeTemplate,
630 const uint16_t maxCandidates)
631 const = 0;
632
680 virtual
681 std::optional<std::tuple<ReturnStatus,
684 const std::vector<std::byte> &probeTemplate,
685 const SearchSubjectPositionResult &searchResult)
686 const = 0;
687
735 virtual
736 std::optional<std::tuple<ReturnStatus,
739 const std::vector<std::byte> &probeTemplate,
740 const SearchSubjectResult &searchResult)
741 const = 0;
742
743 /**************************************************************/
744
785 static
786 std::shared_ptr<SearchInterface>
788 const std::filesystem::path &configurationDirectory,
789 const std::filesystem::path &databaseDirectory);
790
806 static
807 std::optional<ProductIdentifier>
809
825 static
828
831 SearchInterface(const SearchInterface&) = delete;
833 SearchInterface& operator=(const SearchInterface&) = delete;
835
838 };
839
840 /*
841 * API versioning.
842 *
843 * NIST code will extern the version number symbols. Participant code
844 * shall compile them into their core library.
845 */
846 #ifdef NIST_EXTERN_FRIFTE_E1N_API_VERSION
848 extern uint16_t API_MAJOR_VERSION;
850 extern uint16_t API_MINOR_VERSION;
852 extern uint16_t API_PATCH_VERSION;
853 #else /* NIST_EXTERN_FRIFTE_E1N_API_VERSION */
855 uint16_t API_MAJOR_VERSION{1};
857 uint16_t API_MINOR_VERSION{3};
859 uint16_t API_PATCH_VERSION{0};
860 #endif /* NIST_EXTERN_FRIFTE_E1N_API_VERSION */
861}
862
863#endif /* FRIF_EVALUATIONS_E1N_H_ */
virtual std::tuple< ReturnStatus, std::optional< CreateTemplateResult > > createTemplate(const TemplateType templateType, const std::string &identifier, const std::vector< Sample > &samples) const =0
Extract features from one or more images and encode them into a template.
static Compatibility getCompatibility()
Obtain information about API feature and version compatibility of this implementation.
virtual std::optional< std::tuple< ReturnStatus, std::vector< TemplateData > > > extractTemplateData(const TemplateType templateType, const CreateTemplateResult &templateResult) const =0
Extract information contained within a template.
static std::shared_ptr< ExtractionInterface > getImplementation(const std::filesystem::path &configurationDirectory)
Obtain a managed pointer to an object implementing ExtractionInterface.
static std::optional< ProductIdentifier > getProductIdentifier()
Obtain identification and version information for the extraction portion of this submission.
virtual ReturnStatus createReferenceDatabase(const TemplateArchive &referenceTemplates, const std::filesystem::path &databaseDirectory, const uint64_t maxSize) const =0
Create a reference database on the file system.
virtual std::tuple< ReturnStatus, std::optional< SearchSubjectPositionResult > > searchSubjectPosition(const std::vector< std::byte > &probeTemplate, const uint16_t maxCandidates) const =0
Search the reference database for the samples represented in probeTemplate including the most localiz...
virtual std::optional< std::tuple< ReturnStatus, SubjectPositionCandidateListCorrespondence > > extractCorrespondenceSubjectPosition(const std::vector< std::byte > &probeTemplate, const SearchSubjectPositionResult &searchResult) const =0
Extract pairs of corresponding Minutia between TemplateType::Probe and TemplateType::Reference templa...
static Compatibility getCompatibility()
Obtain information about API feature and version compatibility of this implementation.
virtual std::tuple< ReturnStatus, std::optional< SearchSubjectResult > > searchSubject(const std::vector< std::byte > &probeTemplate, const uint16_t maxCandidates) const =0
Search the reference database for the samples represented in probeTemplate including the most localiz...
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 ReturnStatus load(const uint64_t maxSize)=0
Load reference database into memory.
virtual std::optional< std::tuple< ReturnStatus, SubjectCandidateListCorrespondence > > extractCorrespondenceSubject(const std::vector< std::byte > &probeTemplate, const SearchSubjectResult &searchResult) const =0
Extract pairs of corresponding Minutia between TemplateType::Probe and TemplateType::Reference templa...
static std::optional< ProductIdentifier > getProductIdentifier()
Obtain identification and version information for the search portion of this submission.
FRIF TE Exemplar 1:N functionality.
Definition e1n.h:67
uint16_t API_PATCH_VERSION
API patch version number.
Definition e1n.h:859
LibraryIdentifier getLibraryIdentifier()
uint16_t API_MAJOR_VERSION
API major version number.
Definition e1n.h:855
uint16_t API_MINOR_VERSION
API minor version number.
Definition e1n.h:857
TemplateType
Use for data extracted from Sample.
Definition io.h:357
std::unordered_map< SubjectPositionCandidate, Correspondence, SubjectPositionCandidateListKeyHash > SubjectPositionCandidateListCorrespondence
Representation to output Correspondence for each SubjectPositionCandidate from a SubjectPositionCandi...
Definition io.h:196
std::unordered_map< std::string, Correspondence > SubjectCandidateListCorrespondence
Representation to output Correspondence for each SubjectCandidate from a SubjectCandidateList.
Definition io.h:209
Output from extracting features into a template .
Definition io.h:50
Information used by the NIST testing apparatus to help efficiently test this implementation.
Definition e1n.h:81
std::set< uint16_t > referenceTemplateVersions
LibraryIdentifier::versionNumber of previously-submitted software that generates reference templates ...
Definition e1n.h:120
bool supportsReferenceTemplateIntrospection
Is useful information returned from extractTemplateData() for references?
Definition e1n.h:92
bool supportsProbeTemplateIntrospection
Is useful information returned from extractTemplateData() for probes?
Definition e1n.h:86
std::set< uint16_t > referenceDatabaseVersions
LibraryIdentifier::versionNumber of previously-submitted software that generates reference databases ...
Definition e1n.h:134
std::set< uint16_t > probeTemplateVersions
LibraryIdentifier::versionNumber of previously-submitted software that generates probe templates that...
Definition e1n.h:106
Information used by the NIST testing apparatus to help efficiently test this implementation.
Definition e1n.h:404
bool supportsCorrespondence
Is useful information returned from extractCorrespondence()?
Definition e1n.h:409
std::set< uint16_t > referenceDatabaseVersions
LibraryIdentifier::versionNumber of previously-submitted software that generates reference databases ...
Definition e1n.h:437
std::set< uint16_t > probeTemplateVersions
LibraryIdentifier::versionNumber of previously-submitted software that generates probe templates that...
Definition e1n.h:423
Identification information about the submitted library.
Definition evaluations.h:27
Information about the result of calling a FRIF TE API function.
Definition common.h:29
The results of a searching a database for subject finger positions.
Definition io.h:250
The results of a searching a database for a subject, without respect to finger positions.
Definition io.h:290
Collection of templates on disk.
Definition io.h:327