Friction Ridge Image and Features
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
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 <frif/frif.h>
64
67{
71
74 {
75 public:
81 {
87
100 std::set<uint16_t> probeTemplateVersions{};
101
114 std::set<uint16_t> referenceTemplateVersions{};
115
128 std::set<uint16_t> referenceDatabaseVersions{};
129 };
130
188 virtual
189 std::tuple<ReturnStatus, std::optional<CreateTemplateResult>>
191 const TemplateType templateType,
192 const std::string &identifier,
193 const std::vector<Sample> &samples)
194 const = 0;
195
239 virtual
240 std::optional<std::tuple<ReturnStatus,
241 std::vector<TemplateData>>>
243 const TemplateType templateType,
244 const CreateTemplateResult &templateResult)
245 const = 0;
246
293 virtual
296 const TemplateArchive &referenceTemplates,
297 const std::filesystem::path &databaseDirectory,
298 const uint64_t maxSize)
299 const = 0;
300
301 /**************************************************************/
302
330 static
331 std::shared_ptr<ExtractionInterface>
333 const std::filesystem::path &configurationDirectory);
334
350 static
351 std::optional<ProductIdentifier>
353
369 static
372
377 ExtractionInterface& operator=(const ExtractionInterface&) =
378 delete;
383 };
384
387 {
388 public:
394 {
400
413 std::set<uint16_t> probeTemplateVersions{};
414
427 std::set<uint16_t> referenceDatabaseVersions{};
428 };
429
489 virtual
492 const uint64_t maxSize) = 0;
493
494 /**************************************************************/
495
551 virtual
552 std::tuple<ReturnStatus, std::optional<SearchResult>>
554 const std::vector<std::byte> &probeTemplate,
555 const uint16_t maxCandidates)
556 const = 0;
557
604 virtual
605 std::optional<CandidateListCorrespondence>
607 const std::vector<std::byte> &probeTemplate,
608 const SearchResult &searchResult)
609 const = 0;
610
611 /**************************************************************/
612
653 static
654 std::shared_ptr<SearchInterface>
656 const std::filesystem::path &configurationDirectory,
657 const std::filesystem::path &databaseDirectory);
658
674 static
675 std::optional<ProductIdentifier>
677
693 static
696
699 SearchInterface(const SearchInterface&) = delete;
701 SearchInterface& operator=(const SearchInterface&) = delete;
706 };
707
708 /*
709 * API versioning.
710 *
711 * NIST code will extern the version number symbols. Participant code
712 * shall compile them into their core library.
713 */
714 #ifdef NIST_EXTERN_FRIF_E1N_API_VERSION
716 extern uint16_t API_MAJOR_VERSION;
718 extern uint16_t API_MINOR_VERSION;
720 extern uint16_t API_PATCH_VERSION;
721 #else /* NIST_EXTERN_FRIF_E1N_API_VERSION */
723 uint16_t API_MAJOR_VERSION{0};
725 uint16_t API_MINOR_VERSION{0};
727 uint16_t API_PATCH_VERSION{1};
728 #endif /* NIST_EXTERN_FRIF_E1N_API_VERSION */
729}
730
731#endif /* FRIF_EVALUATIONS_E1N_H_ */
Interface for feature extraction implemented by participant.
Definition e1n.h:74
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.
Interface for database search implemented by participant.
Definition e1n.h:387
virtual std::tuple< ReturnStatus, std::optional< SearchResult > > search(const std::vector< std::byte > &probeTemplate, const uint16_t maxCandidates) const =0
Search the reference database for the samples represented in probeTemplate.
static Compatibility getCompatibility()
Obtain information about API feature and version compatibility of this implementation.
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< CandidateListCorrespondence > extractCorrespondence(const std::vector< std::byte > &probeTemplate, const SearchResult &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:727
LibraryIdentifier getLibraryIdentifier()
uint16_t API_MAJOR_VERSION
API major version number.
Definition e1n.h:723
uint16_t API_MINOR_VERSION
API minor version number.
Definition e1n.h:725
TemplateType
Use for data extracted from Sample.
Definition io.h:281
Output from extracting features into a template .
Definition io.h:55
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:114
bool supportsTemplateIntrospection
Is useful information returned from extractTemplateData()?
Definition e1n.h:86
std::set< uint16_t > referenceDatabaseVersions
LibraryIdentifier::versionNumber of previously-submitted software that generates reference databases ...
Definition e1n.h:128
std::set< uint16_t > probeTemplateVersions
LibraryIdentifier::versionNumber of previously-submitted software that generates probe templates that...
Definition e1n.h:100
Information used by the NIST testing apparatus to help efficiently test this implementation.
Definition e1n.h:394
bool supportsCorrespondence
Is useful information returned from extractCorrespondence()?
Definition e1n.h:399
std::set< uint16_t > referenceDatabaseVersions
LibraryIdentifier::versionNumber of previously-submitted software that generates reference databases ...
Definition e1n.h:427
std::set< uint16_t > probeTemplateVersions
LibraryIdentifier::versionNumber of previously-submitted software that generates probe templates that...
Definition e1n.h:413
Identification information about the submitted library.
Definition evaluations.h:27
Information about the result of calling a FRIF API function.
Definition common.h:29
The results of a searching a database.
Definition io.h:213
Collection of templates on disk.
Definition io.h:251