Friction Ridge Image and Features
API for participating in NIST's Friction Ridge Image and Features Technology Evaluations.
Loading...
Searching...
No Matches
io.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
11#ifndef FRIF_IO_H_
12#define FRIF_IO_H_
13
14#include <cstdint>
15#include <filesystem>
16#include <optional>
17#include <string>
18#include <unordered_map>
19#include <vector>
20
21#include <frif/common.h>
22#include <frif/efs.h>
23
25namespace FRIF
26{
36 {
41 std::string candidateIdentifier{};
42
44 uint8_t inputIdentifier{};
45
47 std::optional<EFS::Features> features{};
48
50 std::optional<uint8_t> imageQuality{};
51 };
52
55 {
57 std::vector<std::byte> data{};
58
82 std::optional<std::vector<TemplateData>> extractedData{};
83 };
84
87 {
97 std::vector<EFS::CorrespondenceRelationship> correspondence{};
98
108 std::optional<bool> complex{};
109 };
110
113 {
115 std::string identifier{};
118
128 Candidate(
129 const std::string &identifier = {},
131
132 auto operator<=>(const Candidate&) const;
133 bool operator==(const Candidate&) const;
134 };
135
138 {
139 std::size_t
141 const FRIF::Candidate &c)
142 const
143 noexcept;
144 };
145
159 using CandidateList = std::unordered_map<Candidate, double,
161
172 using CandidateListCorrespondence = std::unordered_map<Candidate,
173 std::vector<Correspondence>, CandidateListKeyHash>;
174
177 {
182 bool decision{};
183
185 double similarity{};
186
208 std::optional<Correspondence> correspondence{};
209 };
210
213 {
217 bool decision{};
218
224
246 std::optional<Correspondence> correspondence{};
247 };
248
251 {
253 std::filesystem::path archive{};
272 std::filesystem::path manifest{};
273 };
274
276 using Sample = std::tuple<std::optional<Image>,
277 std::optional<EFS::Features>>;
278
280 enum class TemplateType
281 {
286 Probe,
292 };
293}
294
295#endif /* FRIF_IO_H_ */
FrictionRidgeGeneralizedPosition
Friction positions codes from ANSI/NIST-ITL 1-2011 (2015).
Definition efs.h:58
TE input/output types.
Definition common.h:26
std::tuple< std::optional< Image >, std::optional< EFS::Features > > Sample
Convenience definition for a friction ridge sample.
Definition io.h:276
std::unordered_map< Candidate, std::vector< Correspondence >, CandidateListKeyHash > CandidateListCorrespondence
Representation to output Correspondence for each Candidate from a CandidateList.
Definition io.h:172
TemplateType
Use for data extracted from Sample.
Definition io.h:281
@ Reference
Use within a database for search, or the initial capture during a comparison.
@ Probe
Item being compared to a reference or searched against a reference database.
std::unordered_map< Candidate, double, CandidateListKeyHash > CandidateList
Representation of a list of likely candidates returned from a search.
Definition io.h:159
Unique entry.
Definition io.h:113
EFS::FrictionRidgeGeneralizedPosition fgp
Most localized position in the identifier.
Definition io.h:117
std::string identifier
Identifier of the sample in the reference database.
Definition io.h:115
bool operator==(const Candidate &) const
Candidate(const std::string &identifier={}, const EFS::FrictionRidgeGeneralizedPosition fgp={})
Candidate constructor.
auto operator<=>(const Candidate &) const
Hash function for Candidate.
Definition io.h:138
std::size_t operator()(const FRIF::Candidate &c) const noexcept
The results of comparing two templates.
Definition io.h:177
double similarity
Quantification of probe's similarity to reference sample.
Definition io.h:185
bool decision
Best guess on if probe and reference come from the same source.
Definition io.h:182
std::optional< Correspondence > correspondence
Pairs of corresponding Minutia between TemplateType::Probe and TemplateType::Reference templates.
Definition io.h:208
Information about a probe/reference relationship.
Definition io.h:87
std::optional< bool > complex
Whether or not the comparison was complex.
Definition io.h:108
std::vector< EFS::CorrespondenceRelationship > correspondence
Groups of relationships between features.
Definition io.h:97
Output from extracting features into a template .
Definition io.h:55
std::vector< std::byte > data
Contents of the template.
Definition io.h:57
std::optional< std::vector< TemplateData > > extractedData
Information contained within data.
Definition io.h:82
The results of a searching a database.
Definition io.h:213
bool decision
Best guess on if candidateList contains an identification.
Definition io.h:217
CandidateList candidateList
List of Candidate most similar to the probe.
Definition io.h:223
std::optional< Correspondence > correspondence
Pairs of corresponding Minutia between TemplateType::Probe and TemplateType::Reference templates.
Definition io.h:246
Collection of templates on disk.
Definition io.h:251
std::filesystem::path archive
File containing concatenated CreateTemplateResult::data.
Definition io.h:253
std::filesystem::path manifest
Manifest for parsing archive.
Definition io.h:272
Information possibly stored in a template.
Definition io.h:36
std::optional< EFS::Features > features
Extended feature set data.
Definition io.h:47
std::string candidateIdentifier
Candidate identifier provided in ExtractionInterface::createTemplate().
Definition io.h:41
uint8_t inputIdentifier
Link to Image::identifier and/or EFS::identifier.
Definition io.h:44
std::optional< uint8_t > imageQuality
Quality of the image, [0-100].
Definition io.h:50