Face Engine SDK  5.23.1
A face detection, recognition and tracking engine.
include/fsdk/Estimators/IEyeEstimator.h
00001 #pragma once
00002 
00003 #include <fsdk/IObject.h>
00004 #include <fsdk/FSDKError.h>
00005 #include <fsdk/Optional.h>
00006 #include <fsdk/Types.h>
00007 
00008 namespace fsdk {
00009 
00010 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00011     DECLARE_SMARTPTR(IEyeEstimator);
00012 #endif
00013 
00023     struct EyesEstimation {
00027         struct EyeAttributes {
00031             enum class State : uint8_t {
00032                 Closed,  
00033                 Open,    
00034                 Occluded 
00035             };
00036 
00037             static constexpr uint64_t irisLandmarksCount = 32;  
00038             static constexpr uint64_t eyelidLandmarksCount = 6; 
00039 
00041             using IrisLandmarks = Landmarks<irisLandmarksCount>;
00042 
00044             using EyelidLandmarks = Landmarks<eyelidLandmarksCount>;
00045 
00046             State state; 
00047 
00048             IrisLandmarks iris;     
00049             EyelidLandmarks eyelid; 
00050         };
00051 
00052         EyeAttributes leftEye;  
00053         EyeAttributes rightEye; 
00054     };
00055 
00060     struct FSDK_API EyeCropper {
00061         struct EyesRects {
00062             Rect leftEyeRect;
00063             Rect rightEyeRect;
00064         };
00065 
00066         EyesRects cropByLandmarks5(const Image& warp, const Landmarks5& landmarks5);
00067 
00068         EyeCropper::EyesRects cropByLandmarks68(const Image& warp, const Landmarks68& landmarks68);
00069     };
00070 
00081     struct IEyeEstimator : IRefCounted {
00096         virtual Result<FSDKError> estimate(
00097             const Image& warp,
00098             const EyeCropper::EyesRects& eyeRects,
00099             EyesEstimation& eyesEstimation) const noexcept = 0;
00100 
00116         virtual Result<FSDKError> estimate(
00117             Span<const Image> warps,
00118             Span<const EyeCropper::EyesRects> eyeRects,
00119             Span<EyesEstimation> eyesEstimations) const noexcept = 0;
00120 
00133         virtual Result<FSDKError> validate(
00134             Span<const Image> warps,
00135             Span<const EyeCropper::EyesRects> eyeRects,
00136             Span<Result<FSDKError>> errors) const noexcept = 0;
00137     };
00138 
00140 } // namespace fsdk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines