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

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
IQualityEstimator.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(IQualityEstimator);
12 #endif
13
22 struct Quality {
23 float light;
24 float dark;
25 float gray;
26 float blur;
30 inline float getQuality() const noexcept;
31 };
32
47 struct SubjectiveQuality {
48 float blur;
49 float light;
50 float darkness;
51 float illumination;
52 float specularity;
53 bool isBlurred;
54 bool isHighlighted;
55 bool isDark;
56 bool isIlluminated;
57 bool isNotSpecular;
61 inline bool isGood() const noexcept;
62 };
63
77 struct IQualityEstimator : IRefCounted {
84 virtual Result<FSDKError>
85 estimate(const Image& warp, Quality& quality) const noexcept = 0;
86
93 virtual Result<FSDKError> estimate(
94 const Image& image,
95 SubjectiveQuality& quality) const noexcept = 0;
96 };
97
98 /*
99 Implementation details.
100 */
101 float Quality::getQuality() const noexcept {
102 float min1 = std::min(dark, light);
103 float min2 = std::min(gray, blur);
104 return std::min(min1, min2);
105 }
106
107 /*
108 Implementation details.
109 */
110 bool SubjectiveQuality::isGood() const noexcept {
111 if (!isBlurred && !isHighlighted && !isDark && !isIlluminated && !isNotSpecular)
112 return true;
113 return false;
114 }
115
116 } // namespace fsdk
DECLARE_SMARTPTR
#define DECLARE_SMARTPTR(X)
Smart ptr declaration helper macro.
Definition: Def.h:59
fsdk::Result
A structure that encapsulates an action result enumeration.
Definition: Result.h:29
Types.h
Common data types and structures.
fsdk::Quality
Quality estimation structure Each estimation is given in normalized [0, 1] range. Parameter meanings:...
Definition: IQualityEstimator.h:22
fsdk::SubjectiveQuality
Subjective Quality estimation structure Each estimation is given in normalized [0, 1] range. Parameter meanings:
Definition: IQualityEstimator.h:47
IObject.h
Object system types and interfaces.
FSDKError.h
Common SDK error codes.
fsdk::SubjectiveQuality::isGood
bool isGood() const noexcept
Definition: IQualityEstimator.h:110
fsdk::IRefCounted
Base strong reference counted object interface.
Definition: IRefCounted.h:36
fsdk::Quality::getQuality
float getQuality() const noexcept
Definition: IQualityEstimator.h:101
fsdk::IQualityEstimator::estimate
virtual Result< FSDKError > estimate(const Image &warp, Quality &quality) const noexcept=0
Estimate the quality.
fsdk::Image
Image.
Definition: Image.h:37
fsdk::IQualityEstimator
Image quality estimator interface.
Definition: IQualityEstimator.h:77