22#include <enrollment/Export.h>
30 INNO_ENROLLMENT_API
void inno_ofiq_get_bounding_box(
void* impl,
35 ErrorCallbacks error);
36 INNO_ENROLLMENT_API uint8_t inno_ofiq_get_sharpness(
void* impl, ErrorCallbacks error);
37 INNO_ENROLLMENT_API uint8_t inno_ofiq_get_unified_quality_score(
void* impl, ErrorCallbacks error);
38 INNO_ENROLLMENT_API uint8_t inno_ofiq_get_background_uniformity(
void* impl, ErrorCallbacks error);
39 INNO_ENROLLMENT_API uint8_t inno_ofiq_get_illumination_uniformity(
void* impl, ErrorCallbacks error);
40 INNO_ENROLLMENT_API uint8_t inno_ofiq_get_luminance_mean(
void* impl, ErrorCallbacks error);
41 INNO_ENROLLMENT_API uint8_t inno_ofiq_get_luminance_variance(
void* impl, ErrorCallbacks error);
42 INNO_ENROLLMENT_API uint8_t inno_ofiq_get_under_exposure_prevention(
void* impl, ErrorCallbacks error);
43 INNO_ENROLLMENT_API uint8_t inno_ofiq_get_over_exposure_prevention(
void* impl, ErrorCallbacks error);
44 INNO_ENROLLMENT_API uint8_t inno_ofiq_get_dynamic_range(
void* impl, ErrorCallbacks error);
45 INNO_ENROLLMENT_API uint8_t inno_ofiq_get_compression_artifacts(
void* impl, ErrorCallbacks error);
46 INNO_ENROLLMENT_API uint8_t inno_ofiq_get_natural_colour(
void* impl, ErrorCallbacks error);
47 INNO_ENROLLMENT_API uint8_t inno_ofiq_get_single_face_present(
void* impl, ErrorCallbacks error);
48 INNO_ENROLLMENT_API uint8_t inno_ofiq_get_eyes_open(
void* impl, ErrorCallbacks error);
49 INNO_ENROLLMENT_API uint8_t inno_ofiq_get_mouth_closed(
void* impl, ErrorCallbacks error);
50 INNO_ENROLLMENT_API uint8_t inno_ofiq_get_eyes_visible(
void* impl, ErrorCallbacks error);
51 INNO_ENROLLMENT_API uint8_t inno_ofiq_get_mouth_occlusion_prevention(
void* impl, ErrorCallbacks error);
52 INNO_ENROLLMENT_API uint8_t inno_ofiq_get_face_occlusion_prevention(
void* impl, ErrorCallbacks error);
53 INNO_ENROLLMENT_API uint8_t inno_ofiq_get_inter_eye_distance(
void* impl, ErrorCallbacks error);
54 INNO_ENROLLMENT_API uint8_t inno_ofiq_get_head_size(
void* impl, ErrorCallbacks error);
55 INNO_ENROLLMENT_API uint8_t inno_ofiq_get_leftward_crop_of_the_face_image(
void* impl, ErrorCallbacks error);
56 INNO_ENROLLMENT_API uint8_t inno_ofiq_get_rightward_crop_of_the_face_image(
void* impl, ErrorCallbacks error);
57 INNO_ENROLLMENT_API uint8_t inno_ofiq_get_margin_above_of_the_face_image(
void* impl, ErrorCallbacks error);
58 INNO_ENROLLMENT_API uint8_t inno_ofiq_get_margin_below_of_the_face_image(
void* impl, ErrorCallbacks error);
59 INNO_ENROLLMENT_API uint8_t inno_ofiq_get_head_pose_yaw(
void* impl, ErrorCallbacks error);
60 INNO_ENROLLMENT_API uint8_t inno_ofiq_get_head_pose_pitch(
void* impl, ErrorCallbacks error);
61 INNO_ENROLLMENT_API uint8_t inno_ofiq_get_head_pose_roll(
void* impl, ErrorCallbacks error);
62 INNO_ENROLLMENT_API uint8_t inno_ofiq_get_expression_neutrality(
void* impl, ErrorCallbacks error);
63 INNO_ENROLLMENT_API uint8_t inno_ofiq_get_no_head_coverings(
void* impl, ErrorCallbacks error);
73 class OFIQFace :
public Serializable
89 static std::shared_ptr<OFIQFace>
Create(
const std::shared_ptr<FaceCapture>& capture,
90 const std::shared_ptr<FaceExecutor>& executor)
92 if (capture ==
nullptr)
96 if (executor ==
nullptr)
101 auto bgr = capture->image->AsRawBGR();
102 FaceDestroyer deleter =
nullptr;
107 static_cast<unsigned int>(bgr.dpi),
112 auto pimpl = std::unique_ptr<void, FaceDestroyer>(ptr, deleter);
113 return std::shared_ptr<OFIQFace>(
new OFIQFace(std::move(pimpl)));
127 static std::shared_ptr<OFIQFace>
Create(
const std::shared_ptr<FaceCapture>& capture)
138 auto writeOnSuccess = [&writer](
const char* name,
auto&& func)
143 writer.Write(name, value);
150 writeOnSuccess(
"sh", [
this]() {
return GetSharpness(); });
162 writeOnSuccess(
"eo", [
this]() {
return GetEyesOpen(); });
168 writeOnSuccess(
"hs", [
this]() {
return GetHeadSize(); });
190 inno_ofiq_get_bounding_box(impl.get(), &topLeftX, &topLeftY, &width, &height, ThrowOnError{});
191 return { { topLeftX, topLeftY },
192 {
static_cast<X>(topLeftX + width), topLeftY },
193 {
static_cast<X>(topLeftX + width),
static_cast<Y>(topLeftY + height) },
194 { topLeftX,
static_cast<Y>(topLeftY + height) } };
210 return inno_ofiq_get_sharpness(impl.get(), ThrowOnError{});
221 return inno_ofiq_get_unified_quality_score(impl.get(), ThrowOnError{});
231 return inno_ofiq_get_background_uniformity(impl.get(), ThrowOnError{});
242 return inno_ofiq_get_illumination_uniformity(impl.get(), ThrowOnError{});
252 return inno_ofiq_get_luminance_mean(impl.get(), ThrowOnError{});
262 return inno_ofiq_get_luminance_variance(impl.get(), ThrowOnError{});
272 return inno_ofiq_get_under_exposure_prevention(impl.get(), ThrowOnError{});
282 return inno_ofiq_get_over_exposure_prevention(impl.get(), ThrowOnError{});
292 return inno_ofiq_get_dynamic_range(impl.get(), ThrowOnError{});
302 return inno_ofiq_get_compression_artifacts(impl.get(), ThrowOnError{});
313 return inno_ofiq_get_natural_colour(impl.get(), ThrowOnError{});
323 return inno_ofiq_get_single_face_present(impl.get(), ThrowOnError{});
333 return inno_ofiq_get_eyes_open(impl.get(), ThrowOnError{});
343 return inno_ofiq_get_mouth_closed(impl.get(), ThrowOnError{});
353 return inno_ofiq_get_eyes_visible(impl.get(), ThrowOnError{});
363 return inno_ofiq_get_mouth_occlusion_prevention(impl.get(), ThrowOnError{});
373 return inno_ofiq_get_face_occlusion_prevention(impl.get(), ThrowOnError{});
384 return inno_ofiq_get_inter_eye_distance(impl.get(), ThrowOnError{});
394 return inno_ofiq_get_head_size(impl.get(), ThrowOnError{});
404 return inno_ofiq_get_leftward_crop_of_the_face_image(impl.get(), ThrowOnError{});
414 return inno_ofiq_get_rightward_crop_of_the_face_image(impl.get(), ThrowOnError{});
424 return inno_ofiq_get_margin_above_of_the_face_image(impl.get(), ThrowOnError{});
434 return inno_ofiq_get_margin_below_of_the_face_image(impl.get(), ThrowOnError{});
444 return inno_ofiq_get_head_pose_yaw(impl.get(), ThrowOnError{});
454 return inno_ofiq_get_head_pose_pitch(impl.get(), ThrowOnError{});
464 return inno_ofiq_get_head_pose_roll(impl.get(), ThrowOnError{});
474 return inno_ofiq_get_expression_neutrality(impl.get(), ThrowOnError{});
484 return inno_ofiq_get_no_head_coverings(impl.get(), ThrowOnError{});
495 explicit OFIQFace(std::unique_ptr<void, FaceDestroyer> pimpl)
496 : impl(std::move(pimpl))
500 std::unique_ptr<void, FaceDestroyer> impl;
static std::shared_ptr< FaceExecutor > Get()
Provides current executor.
Definition FaceExecutor.h:1361
static std::shared_ptr< Logger > Get()
Provides current logger.
Definition Logger.h:281
Null argument is not allowed.
Definition EnrollmentException.h:156
It provides quality measures as defined in ISO/IEC 29794-5:2025.
Definition OFIQFace.h:73
uint8_t GetOverExposurePrevention() const
Over-exposure prevention.
Definition OFIQFace.h:279
uint8_t GetLeftwardCropOfTheFaceImage() const
Leftward crop of the face image.
Definition OFIQFace.h:401
uint8_t GetNaturalColour() const
Natural colour of the face image.
Definition OFIQFace.h:310
void WriteTo(Writer &writer) const final
Serialize OFIQFace to Writer.
Definition OFIQFace.h:135
uint8_t GetMarginAboveOfTheFaceImage() const
Margin above the face image.
Definition OFIQFace.h:421
uint8_t GetHeadPoseRoll() const
Head pose roll (tilt about the nose axis).
Definition OFIQFace.h:461
uint8_t GetIlluminationUniformity() const
Illumination uniformity across the face.
Definition OFIQFace.h:239
uint8_t GetRightwardCropOfTheFaceImage() const
Rightward crop of the face image.
Definition OFIQFace.h:411
uint8_t GetMarginBelowOfTheFaceImage() const
Margin below the face image.
Definition OFIQFace.h:431
uint8_t GetNoHeadCoverings() const
No head coverings.
Definition OFIQFace.h:481
uint8_t GetCompressionArtifacts() const
Absence of compression artefacts.
Definition OFIQFace.h:299
Rectangle GetBoundingBox() const
Provides bounding box of detected face.
Definition OFIQFace.h:183
uint8_t GetInterEyeDistance() const
Inter-eye distance quality.
Definition OFIQFace.h:381
uint8_t GetEyesVisible() const
Eyes visible.
Definition OFIQFace.h:350
uint8_t GetLuminanceMean() const
Luminance mean of the face image.
Definition OFIQFace.h:249
uint8_t GetUnderExposurePrevention() const
Under-exposure prevention.
Definition OFIQFace.h:269
static std::shared_ptr< OFIQFace > Create(const std::shared_ptr< FaceCapture > &capture)
Create OFIQ from FaceCapture using default executor set in GlobalFaceExecutor.
Definition OFIQFace.h:126
uint8_t GetEyesOpen() const
Eyes open.
Definition OFIQFace.h:330
uint8_t GetMouthClosed() const
Mouth closed.
Definition OFIQFace.h:340
uint8_t GetSingleFacePresent() const
Single face present in the image.
Definition OFIQFace.h:320
uint8_t GetLuminanceVariance() const
Luminance variance in the face image.
Definition OFIQFace.h:259
uint8_t GetHeadSize() const
Head size in the image.
Definition OFIQFace.h:391
uint8_t GetBackgroundUniformity() const
Background uniformity of the face image.
Definition OFIQFace.h:228
uint8_t GetDynamicRange() const
Dynamic range of the face image.
Definition OFIQFace.h:289
static std::shared_ptr< OFIQFace > Create(const std::shared_ptr< FaceCapture > &capture, const std::shared_ptr< FaceExecutor > &executor)
Create OFIQ from FaceCapture using the given executor.
Definition OFIQFace.h:88
uint8_t GetHeadPosePitch() const
Head pose pitch (up-down tilt).
Definition OFIQFace.h:451
uint8_t GetHeadPoseYaw() const
Head pose yaw (left-right rotation).
Definition OFIQFace.h:441
uint8_t GetUnifiedQualityScore() const
Unified quality score (QS) mapping native OFIQ quality.
Definition OFIQFace.h:218
uint8_t GetFaceOcclusionPrevention() const
Face occlusion prevention.
Definition OFIQFace.h:370
uint8_t GetMouthOcclusionPrevention() const
Mouth occlusion prevention.
Definition OFIQFace.h:360
uint8_t GetExpressionNeutrality() const
Expression neutrality.
Definition OFIQFace.h:471
uint8_t GetSharpness() const
Provides sharpness of the face.
Definition OFIQFace.h:207
It holds rectangle vertexes, width, height.
Definition ImageAttribute.h:357
Provides interface for serialization of all classes.
Definition Writer.h:164
int Y
Y coordinate.
Definition ImageAttribute.h:117
int X
X coordinate.
Definition ImageAttribute.h:112