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 #include <cmath> 00009 00010 namespace fsdk { 00011 00012 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00013 DECLARE_SMARTPTR(IHeadPoseEstimator); 00014 #endif 00015 00026 struct HeadPoseEstimation { 00027 float pitch; 00028 float yaw; 00029 float roll; 00030 00031 enum FrontalFaceType { 00032 Non = 0, 00033 Good, 00034 ISO 00035 }; 00036 00040 inline FrontalFaceType getFrontalFaceType() const; 00041 }; 00042 00053 struct IHeadPoseEstimator : IRefCounted { 00061 virtual Result<FSDKError> 00062 FSDK_DEPRECATED("HeadPoseEstimator is deprecated since v.5.0.1, use BestShotQualityEstimator instead") 00063 estimate( 00064 const Landmarks68 &landmarks, 00065 HeadPoseEstimation& out) const noexcept = 0; 00075 virtual Result<FSDKError> 00076 FSDK_DEPRECATED("HeadPoseEstimator is deprecated since v.5.0.1, use BestShotQualityEstimator instead") 00077 estimate( 00078 const Image& image, 00079 const Detection& detection, 00080 HeadPoseEstimation& out) const noexcept = 0; 00081 00093 virtual Result<FSDKError> 00094 FSDK_DEPRECATED("HeadPoseEstimator is deprecated since v.5.0.1, use BestShotQualityEstimator instead") 00095 estimate( 00096 Span<const Image> images, 00097 Span<const Detection> detections, 00098 Span<HeadPoseEstimation> out) const noexcept = 0; 00099 00111 virtual Result<FSDKError> 00112 FSDK_DEPRECATED("HeadPoseEstimator is deprecated since v.5.0.1, use BestShotQualityEstimator instead") 00113 validate( 00114 Span<const Image> images, 00115 Span<const Detection> detections, 00116 Span<Result<FSDKError>> errors) const noexcept = 0; 00117 }; 00118 00119 /* 00120 Implementation details. 00121 */ 00122 HeadPoseEstimation::FrontalFaceType 00123 HeadPoseEstimation::getFrontalFaceType() const { 00124 if(std::abs(roll) <= 8 && std::abs(pitch) <= 5 && std::abs(yaw) <= 5) 00125 return HeadPoseEstimation::ISO; 00126 if(std::abs(roll) <= 30 && std::abs(pitch) <= 40 && std::abs(yaw) <= 40) 00127 return HeadPoseEstimation::Good; 00128 return HeadPoseEstimation::Non; 00129 } 00131 } // namespace fsdk