46 class FaceAttributeReliability
55 virtual std::vector<FailedFaceAttribute>
Validate(
const std::shared_ptr<Face>& probe) = 0;
57 FaceAttributeReliability() =
default;
58 FaceAttributeReliability(FaceAttributeReliability&&) =
delete;
59 FaceAttributeReliability(
const FaceAttributeReliability&) =
delete;
60 FaceAttributeReliability& operator=(FaceAttributeReliability&&) =
delete;
61 FaceAttributeReliability& operator=(
const FaceAttributeReliability&) =
delete;
62 virtual ~FaceAttributeReliability() =
default;
69 class ICAOReliability final :
public FaceAttributeReliability
97 std::vector<FailedFaceAttribute>
Validate(
const std::shared_ptr<Face>& probe)
final
104 std::vector<FailedFaceAttribute> failed;
106 if (probe->confidence < 600)
111 if (probe->YawAngle() < -10 || probe->YawAngle() > 10)
115 if (probe->PitchAngle() < -10 || probe->PitchAngle() > 10)
120 if (probe->Sharpness() < 0)
124 if (probe->Brightness() < -5000 || probe->Brightness() > 5000)
129 if (probe->Contrast() < -5000 || probe->Contrast() > 5000)
133 if (probe->UniqueIntensityLevels() < 0)
138 if (probe->Shadow() < -200)
142 if (probe->NoseShadow() < -80)
147 if (probe->Specularity() < -100)
152 if (probe->HeavyFrame() > 300)
157 if (probe->MouthStatus() < 0)
162 if (probe->BackgroundUniformity() < -1000)
167 if (probe->RollAngle() < -10 || probe->RollAngle() > 10)
171 if (probe->RightEyeStatus() < 0)
176 if (probe->LeftEyeStatus() < 0)
181 if (
constexpr int MaxRedEye = 0; probe->RightRedEye() > MaxRedEye)
186 if (
constexpr int MaxRedEye = 0; probe->LeftRedEye() > MaxRedEye)
191 if (
constexpr int MinGaze = -400; probe->EyeGaze() < MinGaze)
211 class TemplateReliability final :
public FaceAttributeReliability
221 std::vector<FailedFaceAttribute>
Validate(
const std::shared_ptr<Face>& probe)
final
223 if (probe ==
nullptr)
228 std::vector<FailedFaceAttribute> failed;
230 if (probe->confidence < 600)
251 class AgeReliability final :
public FaceAttributeReliability
261 std::vector<FailedFaceAttribute>
Validate(
const std::shared_ptr<Face>& probe)
final
263 if (probe ==
nullptr)
268 std::vector<FailedFaceAttribute> failed;
270 if (probe->confidence < 600)
275 if (probe->FaceSize() < 36)
280 if (probe->YawAngle() < -20 || probe->YawAngle() > 20)
284 if (probe->PitchAngle() < -15 || probe->PitchAngle() > 15)
305 class GlassStatusReliability final :
public FaceAttributeReliability
314 std::vector<FailedFaceAttribute>
Validate(
const std::shared_ptr<Face>& probe)
final
316 if (probe ==
nullptr)
321 std::vector<FailedFaceAttribute> failed;
323 if (probe->confidence < 600)
328 if (probe->YawAngle() < -40 || probe->YawAngle() > 40)
332 if (probe->PitchAngle() < -40 || probe->PitchAngle() > 40)
353 class TintedGlassesReliability final :
public FaceAttributeReliability
363 std::vector<FailedFaceAttribute>
Validate(
const std::shared_ptr<Face>& probe)
final
365 if (probe ==
nullptr)
370 std::vector<FailedFaceAttribute> failed;
372 if (probe->confidence < 600)
377 if (probe->YawAngle() < -40 || probe->YawAngle() > 40)
381 if (probe->PitchAngle() < -40 || probe->PitchAngle() > 40)
403 class SegmentationMaskReliability final :
public FaceAttributeReliability
413 std::vector<FailedFaceAttribute>
Validate(
const std::shared_ptr<Face>& probe)
final
415 if (probe ==
nullptr)
420 std::vector<FailedFaceAttribute> failed;
422 if (probe->confidence < 600)
427 if (probe->YawAngle() < -10 || probe->YawAngle() > 10)
431 if (probe->PitchAngle() < -10 || probe->PitchAngle() > 10)
452 class FaceSizeReliability final :
public FaceAttributeReliability
462 std::vector<FailedFaceAttribute>
Validate(
const std::shared_ptr<Face>& probe)
final
464 if (probe ==
nullptr)
469 std::vector<FailedFaceAttribute> failed;
471 if (probe->confidence < 600)
492 class MouthOpennessReliability final :
public FaceAttributeReliability
502 std::vector<FailedFaceAttribute>
Validate(
const std::shared_ptr<Face>& probe)
final
504 if (probe ==
nullptr)
509 std::vector<FailedFaceAttribute> failed;
511 if (probe->confidence < 600)
516 if (probe->YawAngle() < -30 || probe->YawAngle() > 30)
520 if (probe->PitchAngle() < -30 || probe->PitchAngle() > 30)
541 class UniversalPassiveLivenessReliability final :
public FaceAttributeReliability
552 std::vector<FailedFaceAttribute>
Validate(
const std::shared_ptr<Face>& probe)
final
554 if (probe ==
nullptr)
559 std::vector<FailedFaceAttribute> failed;
560 constexpr unsigned int MinAllowedConfidence = 1000;
561 constexpr unsigned int MaxAllowedConfidence = 10000;
562 if (probe->confidence < MinAllowedConfidence)
565 MinAllowedConfidence,
566 MaxAllowedConfidence,
567 static_cast<float>(probe->confidence) });
591 class ISOFullFrontalImageValidator final :
public FaceAttributeReliability
601 std::vector<FailedFaceAttribute>
Validate(
const std::shared_ptr<Face>& probe)
final
603 if (probe ==
nullptr)
608 std::vector<FailedFaceAttribute> failed;
610 constexpr float MinRatio = 1.F / 1.34F;
611 constexpr float MaxRatio = 1.F / 1.25F;
612 if ((probe->WidthHeightRatio() < MinRatio || probe->WidthHeightRatio() > MaxRatio))
Check if calculation of Age attribute will be reliable.
Definition FaceValidation.h:251
std::vector< FailedFaceAttribute > Validate(const std::shared_ptr< Face > &probe) final
Check if calculation of Age attribute will be reliable.
Definition FaceValidation.h:260
virtual std::vector< FailedFaceAttribute > Validate(const std::shared_ptr< Face > &probe)=0
Check if face is reliable to calculate attribute.
Check if calculation of Face Size attribute will be reliable.
Definition FaceValidation.h:452
std::vector< FailedFaceAttribute > Validate(const std::shared_ptr< Face > &probe) final
Check if calculation of Face Size attribute will be reliable.
Definition FaceValidation.h:461
AttributeID
Face attributes IDs.
Definition Face.h:1852
@ LEFT_RED_EYE
Attribute for evaluating whether red-eye effect is not present on left eye.
Definition Face.h:1906
@ LEFT_EYE_STATUS
Attribute for evaluating left eye status.
Definition Face.h:1885
@ BACKGROUND_UNIFORMITY
Attribute used to measure background uniformity in the close area around the detected face in the ori...
Definition Face.h:1897
@ BRIGHTNESS
Brightness attribute used to measure the brightness level of an area of the detected face in the orig...
Definition Face.h:1861
@ SHARPNESS
Sharpness attribute used to measure the sharpness level of an area of the detected face in the origin...
Definition Face.h:1858
@ WIDTH_HEIGHT_RATIO
Attribute representing width to height aspect ratio of the original face capture.
Definition Face.h:1936
@ YAW_ANGLE
Attribute representing the head rotation angle around the Y-axis of the detected face in the original...
Definition Face.h:1921
@ PITCH_ANGLE
Attribute representing the head rotation angle around the X-axis of the detected face in the original...
Definition Face.h:1918
@ MOUTH_STATUS
Attribute for evaluating mouth status.
Definition Face.h:1894
@ SHADOW
Shadow attribute used to evaluate whether an area of the detected face in the original face capture i...
Definition Face.h:1870
@ FACE_SIZE
Attribute representing face size - the maximum of eye distance and eye-mouth distance.
Definition Face.h:1924
@ CONFIDENCE
Provides confidence score of the face related to face detection.
Definition Face.h:1855
@ RIGHT_RED_EYE
Attribute for evaluating whether red-eye effect is not present on right eye.
Definition Face.h:1903
@ SPECULARITY
Specularity attribute used to evaluate the presence of spotlights in an area of the detected face in ...
Definition Face.h:1876
@ ROLL_ANGLE
Attribute representing the head rotation angle around the Z-axis of the detected face in the original...
Definition Face.h:1915
@ NOSE_SHADOW
Nose Shadow attribute for evaluating whether eyes or a nose don't cast sharp shadows.
Definition Face.h:1873
@ HEAVY_FRAME
Attribute for evaluating whether glasses with heavy frames are not present.
Definition Face.h:1891
@ UNIQUE_INTENSITY_LEVELS
Unique Intensity Levels attribute used to measure whether an area of the detected face in the origina...
Definition Face.h:1867
@ EYE_GAZE
Eye Gaze attribute used to evaluate whether the gaze direction of the detected face in the original f...
Definition Face.h:1879
@ RIGHT_EYE_STATUS
Attribute for evaluating right eye status.
Definition Face.h:1882
@ CONTRAST
Contrast attribute used to measure the contrast level of an area of the detected face in the original...
Definition Face.h:1864
Check if calculation of Glass Status attribute will be reliable.
Definition FaceValidation.h:305
std::vector< FailedFaceAttribute > Validate(const std::shared_ptr< Face > &probe) final
Check if calculation of Glass Status attribute will be reliable.
Definition FaceValidation.h:313
Check if Face will fullfil ICAO requirements.
Definition FaceValidation.h:69
std::vector< FailedFaceAttribute > Validate(const std::shared_ptr< Face > &probe) final
Check if Face will fullfil ICAO requirements.
Definition FaceValidation.h:96
Check if usage of Full Frontal Images on travel documents will follow best practices,...
Definition FaceValidation.h:591
std::vector< FailedFaceAttribute > Validate(const std::shared_ptr< Face > &probe) final
Check if usage of Full Frontal image on travel documents will be reliable.
Definition FaceValidation.h:600
Check if calculation of Mouth Openness attribute will be reliable.
Definition FaceValidation.h:492
std::vector< FailedFaceAttribute > Validate(const std::shared_ptr< Face > &probe) final
Check if calculation of Mouth Openness attribute will be reliable.
Definition FaceValidation.h:501
Null argument is not allowed.
Definition EnrollmentException.h:156
Check if calculation of Segmentation Mask in functions Face::FaceAreaSegment, Face::FaceAreaSegment(R...
Definition FaceValidation.h:403
std::vector< FailedFaceAttribute > Validate(const std::shared_ptr< Face > &probe) final
Check if calculation of Segmentation Mask in functions Face::FaceAreaSegment, Face::FaceAreaSegment(R...
Definition FaceValidation.h:412
Check if template extraction will be reliable.
Definition FaceValidation.h:211
std::vector< FailedFaceAttribute > Validate(const std::shared_ptr< Face > &probe) final
Check if template extraction will be reliable.
Definition FaceValidation.h:220
Check if calculation of Tinted Glasses attribute will be reliable.
Definition FaceValidation.h:353
std::vector< FailedFaceAttribute > Validate(const std::shared_ptr< Face > &probe) final
Check if calculation of Tinted Glasses attribute will be reliable.
Definition FaceValidation.h:362
Check if calculation of Universal passive liveness will be reliable.
Definition FaceValidation.h:541
std::vector< FailedFaceAttribute > Validate(const std::shared_ptr< Face > &probe) final
Check if calculation of Universal passive liveness will be reliable.
Definition FaceValidation.h:551
It contains attribute data that express which and why attribute fails in reliability check.
Definition FaceValidation.h:24
float value
Current value of attribute.
Definition FaceValidation.h:32
Face::AttributeID id
FaceAttributeID of failed attribute.
Definition FaceValidation.h:26
float max
Maximal value of attribute.
Definition FaceValidation.h:30
float min
Minimal value of attribute.
Definition FaceValidation.h:28