Face Engine SDK
5.17.0
A face detection, recognition and tracking engine.
|
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 00056 00061 struct FSDK_API EyeCropper { 00062 struct EyesRects { 00063 Rect leftEyeRect; 00064 Rect rightEyeRect; 00065 }; 00066 00067 EyesRects 00068 cropByLandmarks5( 00069 const Image& warp, 00070 const Landmarks5& landmarks5 00071 ); 00072 00073 EyeCropper::EyesRects 00074 cropByLandmarks68( 00075 const Image& warp, 00076 const Landmarks68& landmarks68 00077 ); 00078 }; 00079 00080 00090 struct IEyeEstimator : IRefCounted { 00105 virtual Result<FSDKError> 00106 estimate( 00107 const Image& warp, 00108 const EyeCropper::EyesRects& eyeRects, 00109 EyesEstimation& eyesEstimation) const noexcept = 0; 00110 00125 virtual Result<FSDKError> 00126 estimate( 00127 Span<const Image> warps, 00128 Span<const EyeCropper::EyesRects> eyeRects, 00129 Span<EyesEstimation> eyesEstimations) const noexcept = 0; 00130 00142 virtual Result<FSDKError> 00143 validate( 00144 Span<const Image> warps, 00145 Span<const EyeCropper::EyesRects> eyeRects, 00146 Span<Result<FSDKError>> errors) const noexcept = 0; 00147 }; 00149 } // namespace fsdk