| Face Engine SDK 5.2.0 A face detection, recognition and tracking engine.

IEyeEstimator.h
1 #pragma once
2
3 #include <fsdk/IObject.h>
4 #include <fsdk/FSDKError.h>
5 #include <fsdk/Optional.h>
6 #include <fsdk/Types.h>
7
8 namespace fsdk {
9
10 #ifndef DOXYGEN_SHOULD_SKIP_THIS
11 DECLARE_SMARTPTR(IEyeEstimator);
12 #endif
13
18 struct EyesEstimation {
22 struct EyeAttributes {
26 enum class State : uint8_t {
27 Closed,
28 Open,
29 Occluded
30 };
31
32 static constexpr uint64_t irisLandmarksCount = 32;
33 static constexpr uint64_t eyelidLandmarksCount = 6;
34
36 using IrisLandmarks = Landmarks<irisLandmarksCount>;
37
39 using EyelidLandmarks = Landmarks<eyelidLandmarksCount>;
40
41 State state;
42
43 IrisLandmarks iris;
44 EyelidLandmarks eyelid;
45 };
46
47 EyeAttributes leftEye;
48 EyeAttributes rightEye;
49 };
50
51
56 struct FSDK_API EyeCropper {
57
58 struct EyesRects {
59 Rect leftEyeRect;
60 Rect rightEyeRect;
61 };
62
63 EyesRects
64 cropByLandmarks5(
65 const Image& warp,
66 const Landmarks5& landmarks5
67 );
68
69 EyeCropper::EyesRects
70 cropByLandmarks68(
71 const Image& warp,
72 const Landmarks68& landmarks68
73 );
74 };
75
76
86 struct IEyeEstimator : IRefCounted {
87
99 virtual Result<FSDKError>
100 estimate(
101 const Image& warp,
102 const EyeCropper::EyesRects& eyeRects,
103 EyesEstimation& eyesEstimation) const noexcept = 0;
104
116 virtual Result<FSDKError>
117 estimate(
118 Span<const Image> warps,
119 Span<const EyeCropper::EyesRects> eyeRects,
120 Span<EyesEstimation> eyesEstimations) const noexcept = 0;
121
130 virtual Result<FSDKError>
131 validate(
132 Span<const Image> warps,
133 Span<const EyeCropper::EyesRects> eyeRects,
134 Span<Result<FSDKError>> errors) const noexcept = 0;
135 };
136
137 } // namespace fsdk
fsdk::IEyeEstimator::estimate
virtual Result< FSDKError > estimate(Span< const Image > warps, Span< const EyeCropper::EyesRects > eyeRects, Span< EyesEstimation > eyesEstimations) const noexcept=0
Estimate the attributes of multiple warped images in a single estimate function call.
fsdk::Span
Span. @detail Not owning data view. It incapsulated pointer to the continuous array with one or more ...
Definition: Span.h:15
fsdk::EyesEstimation::rightEye
EyeAttributes rightEye
Right eye attributes.
Definition: IEyeEstimator.h:48
fsdk::EyesEstimation::EyeAttributes::State
State
Enumeration of possible eye states.
Definition: IEyeEstimator.h:26
fsdk::EyesEstimation::EyeAttributes::State::Open
@ Open
Eye is open.
fsdk::EyesEstimation::EyeAttributes::eyelidLandmarksCount
static constexpr uint64_t eyelidLandmarksCount
Eyelid landmarks amount.
Definition: IEyeEstimator.h:33
DECLARE_SMARTPTR
#define DECLARE_SMARTPTR(X)
Smart ptr declaration helper macro.
Definition: Def.h:59
fsdk::EyesEstimation::EyeAttributes::eyelid
EyelidLandmarks eyelid
Eyelid landmarks.
Definition: IEyeEstimator.h:44
fsdk
SDK namespace.
Definition: IAGSEstimator.h:8
fsdk::BaseRect< int >
fsdk::EyesEstimation::EyeAttributes::state
State state
State of an eye.
Definition: IEyeEstimator.h:41
fsdk::EyesEstimation::EyeAttributes::iris
IrisLandmarks iris
Iris landmarks.
Definition: IEyeEstimator.h:43
fsdk::EyesEstimation::leftEye
EyeAttributes leftEye
Left eye attributes.
Definition: IEyeEstimator.h:47
FSDK_API
#define FSDK_API
Dummy.
Definition: Def.h:27
fsdk::Landmarks< irisLandmarksCount >
fsdk::IEyeEstimator::validate
virtual Result< FSDKError > validate(Span< const Image > warps, Span< const EyeCropper::EyesRects > eyeRects, Span< Result< FSDKError >> errors) const noexcept=0
Validate input of multiple frames in a single function call.
fsdk::IEyeEstimator::estimate
virtual Result< FSDKError > estimate(const Image &warp, const EyeCropper::EyesRects &eyeRects, EyesEstimation &eyesEstimation) const noexcept=0
Estimate the attributes.
fsdk::EyesEstimation::EyeAttributes::irisLandmarksCount
static constexpr uint64_t irisLandmarksCount
Iris landmarks amount.
Definition: IEyeEstimator.h:32
fsdk::EyesEstimation::EyeAttributes::State::Occluded
@ Occluded
Eye is blocked by something not transparent, or landmark passed to estimator doesn't point to an eye.
fsdk::Result
A structure that encapsulates an action result enumeration.
Definition: Result.h:30
fsdk::EyesEstimation
Eyes estimation output.
Definition: IEyeEstimator.h:18
fsdk::EyeCropper::EyesRects
Definition: IEyeEstimator.h:58
fsdk::Image
Image.
Definition: Image.h:37
fsdk::IEyeEstimator
Eye estimator interface.
Definition: IEyeEstimator.h:86
fsdk::EyesEstimation::EyeAttributes::State::Closed
@ Closed
Eye is closed.
fsdk::EyesEstimation::EyeAttributes
Eyes attribute structure.
Definition: IEyeEstimator.h:22
fsdk::IRefCounted
Base strong reference counted object interface.
Definition: IRefCounted.h:36
fsdk::EyeCropper
EyeCropper is a helper structure for IEyeEstimator interface Methods of this structure crop an input ...
Definition: IEyeEstimator.h:56