39 class ApplicantPrintValidation
50 virtual bool Validate(
const std::shared_ptr<ExtractedPrint>& probe,
51 const std::vector<std::shared_ptr<ExtractedPrint>>& gallery) = 0;
53 ApplicantPrintValidation() =
default;
54 ApplicantPrintValidation(ApplicantPrintValidation&&) =
delete;
55 ApplicantPrintValidation(
const ApplicantPrintValidation&) =
delete;
56 ApplicantPrintValidation& operator=(ApplicantPrintValidation&&) =
delete;
57 ApplicantPrintValidation& operator=(
const ApplicantPrintValidation&) =
delete;
58 virtual ~ApplicantPrintValidation() =
default;
78 const std::scoped_lock lock(invalidatingPrintMux);
79 return invalidatingPrint;
102 bool Validate(
const std::shared_ptr<ExtractedPrint>& probe,
103 const std::vector<std::shared_ptr<ExtractedPrint>>& gallery)
final
105 if (probe ==
nullptr)
110 if (probe->print ==
nullptr)
115 return std::all_of(gallery.cbegin(),
117 [
this, probe](
auto& g)
119 if (probe->print->position == g->print->position)
121 if (probe->SimilarWith(*g, matcher) < samePositionTh)
123 const std::scoped_lock lock(invalidatingPrintMux);
124 invalidatingPrint = g;
130 if (probe->SimilarWith(*g, matcher) > differentPositionTh)
132 const std::scoped_lock lock(invalidatingPrintMux);
133 invalidatingPrint = g;
153 : samePositionTh(samePositionThreshold)
154 , differentPositionTh(differentPositionThreshold)
155 , matcher(printMatcher)
195 mutable std::mutex invalidatingPrintMux;
196 std::shared_ptr<ExtractedPrint> invalidatingPrint;
203 class ApplicantFaceValidation
214 virtual bool Validate(
const std::shared_ptr<ExtractedFace>& probe,
215 const std::vector<std::shared_ptr<ExtractedFace>>& gallery) = 0;
217 ApplicantFaceValidation() =
default;
218 ApplicantFaceValidation(ApplicantFaceValidation&&) =
delete;
219 ApplicantFaceValidation(
const ApplicantFaceValidation&) =
delete;
220 ApplicantFaceValidation& operator=(ApplicantFaceValidation&&) =
delete;
221 ApplicantFaceValidation& operator=(
const ApplicantFaceValidation&) =
delete;
222 virtual ~ApplicantFaceValidation() =
default;
255 class Applicant final :
public Serializable
264 const std::scoped_lock lock(printMutex);
274 const std::scoped_lock lock(faceMutex);
283 const std::scoped_lock lock(irisMutex);
295 std::shared_ptr<ModalitiesTemplate>
ToTemplate()
const
297 const std::scoped_lock lock(printMutex, faceMutex, irisMutex);
324 const std::scoped_lock lock(printMutex, faceMutex, irisMutex);
343 return matcher.
Match(*
this, gallery);
355 std::shared_ptr<ExtractedPrint>
AddUniquePrint(std::shared_ptr<ExtractedPrint> print)
358 auto isValid =
AddValidPrint(std::move(print), defaultFlatteningValidation);
379 if (print ==
nullptr)
384 const std::scoped_lock lock(printMutex);
385 auto isValid = validation.
Validate(print, ps);
389 DoAddPrint(std::move(print));
401 void AddPrint(std::shared_ptr<ExtractedPrint> print)
403 if (print ==
nullptr)
408 DoAddPrint(std::move(print));
417 void AddSlap(std::shared_ptr<SlapCapture> slap)
423 log.LogInfo(
"Adding %v", slap);
424 const std::scoped_lock lock(slapMutex);
425 ss.emplace_back(std::move(slap));
434 void AddThumbs(std::shared_ptr<ThumbsCapture> thumbs)
436 if (thumbs ==
nullptr)
440 log.LogInfo(
"Adding %v", thumbs);
441 const std::scoped_lock lock(thumbsMutex);
442 ts.emplace_back(std::move(thumbs));
464 const std::scoped_lock lock(faceMutex);
466 auto isValid = validation.
Validate(face, fs);
470 DoAddFace(std::move(face));
481 void AddFace(std::shared_ptr<ExtractedFace> face)
488 const std::scoped_lock lock(faceMutex);
489 DoAddFace(std::move(face));
497 void AddIris(std::shared_ptr<ExtractedIris> iris)
504 log.LogInfo(
"Adding %v", iris);
506 const std::scoped_lock lock(irisMutex);
507 ir.emplace_back(std::move(iris));
516 const std::scoped_lock lock(printMutex, faceMutex, irisMutex, slapMutex, thumbsMutex);
518 writer.WriteArray(
"ps", ps);
519 writer.WriteArray(
"fs", fs);
520 writer.WriteArray(
"ir", ir);
521 writer.WriteArray(
"ss", ss);
522 writer.WriteArray(
"ts", ts);
541 mutable std::mutex printMutex;
542 mutable std::mutex faceMutex;
543 mutable std::mutex irisMutex;
544 mutable std::mutex slapMutex;
545 mutable std::mutex thumbsMutex;
546 std::vector<std::shared_ptr<ExtractedPrint>> ps;
547 std::vector<std::shared_ptr<ExtractedFace>> fs;
548 std::vector<std::shared_ptr<ExtractedIris>> ir;
549 std::vector<std::shared_ptr<SlapCapture>> ss;
550 std::vector<std::shared_ptr<ThumbsCapture>> ts;
552 void DoAddPrint(std::shared_ptr<ExtractedPrint> tmpl)
554 log.
LogInfo(
"Adding %v", tmpl->print);
555 ps.emplace_back(std::move(tmpl));
558 void DoAddFace(std::shared_ptr<ExtractedFace> tmpl)
560 log.LogInfo(
"Adding %v", tmpl->face);
561 fs.emplace_back(std::move(tmpl));
unsigned int SimilarityThreshold
It is similarity threshold is threshold used to compare against SimilarityScore.
Definition SimilarityThreshold.h:17
Strategy used in Applicant to accept or reject ExtractedFace.
Definition Applicant.h:203
virtual bool Validate(const std::shared_ptr< ExtractedFace > &probe, const std::vector< std::shared_ptr< ExtractedFace > > &gallery)=0
Check if Face is valid.
It is general matcher for Applicant.
Definition ApplicantMatcher.h:21
virtual ModalityScore Match(const Applicant &probe, const Applicant &gallery) const =0
Calculates similarity score of probe and gallery applicant ICS template for each modality.
Strategy used in Applicant to accept or reject ExtractedPrint.
Definition Applicant.h:39
virtual bool Validate(const std::shared_ptr< ExtractedPrint > &probe, const std::vector< std::shared_ptr< ExtractedPrint > > &gallery)=0
Check if print is valid.
Applicant represent enrolled person.
Definition Applicant.h:255
void AddThumbs(std::shared_ptr< ThumbsCapture > thumbs)
It adds ThumbsCapture to applicant.
Definition Applicant.h:433
ModalityScore SimilarWith(const Applicant &gallery, ApplicantMatcher &matcher) const
Calculates SimilarityScore for each modality.
Definition Applicant.h:340
void WriteTo(Writer &writer) const final
It serializes applicant via provided Writer.
Definition Applicant.h:513
std::vector< std::shared_ptr< ExtractedFace > > GetEnrolledFaces() const
Function provides enrolled Faces.
Definition Applicant.h:271
std::shared_ptr< ExtractedPrint > AddUniquePrint(std::shared_ptr< ExtractedPrint > print)
Validates print according to default FlatteningValidation and adds Print when is valid.
Definition Applicant.h:354
bool AddValidFace(std::shared_ptr< ExtractedFace > face, ApplicantFaceValidation &validation)
Validates Face according to given ApplicantFaceValidation and adds Face when is valid.
Definition Applicant.h:456
bool AddValidPrint(std::shared_ptr< ExtractedPrint > print, ApplicantPrintValidation &validation)
Validates print according to given ApplicantPrintValidation and adds Print when is valid See Custom P...
Definition Applicant.h:376
void AddPrint(std::shared_ptr< ExtractedPrint > print)
Adds Print to applicant.
Definition Applicant.h:400
Applicant()
Constructor uses GLobalLogger.
Definition Applicant.h:527
std::shared_ptr< ModalitiesICSTemplate > ToICSTemplate() const
Converts Applicant to ModalitiesICSTemplate.
Definition Applicant.h:309
void AddIris(std::shared_ptr< ExtractedIris > iris)
It adds Iris to applicant.
Definition Applicant.h:496
void AddFace(std::shared_ptr< ExtractedFace > face)
It adds Face to applicant.
Definition Applicant.h:480
std::vector< std::shared_ptr< ExtractedIris > > GetEnrolledIrises() const
Function provides enrolled Irises.
Definition Applicant.h:280
std::vector< std::shared_ptr< ExtractedPrint > > GetEnrolledPrints() const
Function provides enrolled Prints.
Definition Applicant.h:261
void AddSlap(std::shared_ptr< SlapCapture > slap)
It adds SlapCapture to applicant.
Definition Applicant.h:416
std::shared_ptr< ModalitiesTemplate > ToTemplate() const
Converts Applicant to ModalitiesTemplate.
Definition Applicant.h:294
std::shared_ptr< ModalitiesICSTemplate > ToICSTemplate(ModalitiesICSTemplateFactory &factory) const
Converts Applicant to ModalitiesICSTemplate.
Definition Applicant.h:321
Validates prints against gallery.
Definition Applicant.h:69
FlatteningValidation(SimilarityThreshold samePositionThreshold, SimilarityThreshold differentPositionThreshold, ICSMatcher &printMatcher)
Construct a new Flattening Validation object.
Definition Applicant.h:149
bool Validate(const std::shared_ptr< ExtractedPrint > &probe, const std::vector< std::shared_ptr< ExtractedPrint > > &gallery) final
Check if print is valid.
Definition Applicant.h:101
FlatteningValidation()=default
Construct a new Flattening Validation default object.
std::shared_ptr< ExtractedPrint > GetInvalidatingPrint() const
Function provides ExtractedPrint that causes invalidity of probe.
Definition Applicant.h:75
Holds instance of Logger.
Definition Logger.h:275
It is general matcher for ICS templates.
Definition ICSMatcher.h:22
ICSVerifyMatcher configuration.
Definition ICSVerifyMatcher.h:288
ICSVerifyMatcher is template matcher that uses Innovatrics proprietary verification algorithm.
Definition ICSVerifyMatcher.h:32
Interface for library logging.
Definition Logger.h:45
ModalitiesICSTemplateDefaultFactory creates biometric representations from all modality templates.
Definition ModalitiesICSTemplateDefaultFactory.h:28
ModalitiesICSTemplateFactory creates biometric representations from all modality templates.
Definition ModalitiesICSTemplateFactory.h:26
virtual std::shared_ptr< ModalitiesICSTemplate > CreateModalitiesICSTemplate(const std::vector< std::shared_ptr< ICSTemplate > > &printTemplates, const std::vector< std::shared_ptr< FaceTemplate > > &faceTemplates, const std::vector< std::shared_ptr< IrisTemplate > > &irisTemplates) const =0
It creates ModalitiesICSTemplate.
static std::shared_ptr< ModalitiesTemplate > Create(const std::vector< uint8_t > &data)
Create ModalitiesTemplate object from serialized data.
Definition ModalitiesTemplate.h:120
Contains scores of multiple modalities.
Definition SimilarityScore.h:75
Null argument is not allowed.
Definition EnrollmentException.h:156
It holds all functions and data related to print manipulation.
Definition Print.h:47
Provides interface for serialization of all classes.
Definition Writer.h:164