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

ISubjectiveQualityEstimator.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(ISubjectiveQualityEstimator);
12 #endif
13
33 struct SubjectiveQuality {
34 float blur;
35 float light;
36 float darkness;
37 float illumination;
38 float specularity;
39 bool isBlurred;
40 bool isHighlighted;
41 bool isDark;
42 bool isIlluminated;
43 bool isNotSpecular;
44
48 inline bool isGood() const noexcept;
49 };
50
65 struct ISubjectiveQualityEstimator : IRefCounted {
74 virtual Result<FSDKError> estimate(const Image& warp, SubjectiveQuality& quality) const noexcept = 0;
75
86 virtual Result<FSDKError>
87 estimate(Span<const Image> warps, Span<SubjectiveQuality> quality) const noexcept = 0;
88
99 virtual Result<FSDKError>
100 validate(Span<const Image> warps, Span<Result<FSDKError>> errors) const noexcept = 0;
101 };
102
103 /*
104 Implementation details.
105 */
106 bool SubjectiveQuality::isGood() const noexcept {
107 if(!isBlurred && !isHighlighted && !isDark && !isIlluminated && !isNotSpecular)
108 return true;
109 return false;
110 }
111
113 } // namespace fsdk
DECLARE_SMARTPTR
#define DECLARE_SMARTPTR(X)
Smart ptr declaration helper macro.
Definition: Def.h:70
fsdk
SDK namespace.
Definition: IAGSEstimator.h:8
fsdk::Result
A structure that encapsulates an action result enumeration.
Definition: Result.h:27
Types.h
Common data types and structures.
fsdk::SubjectiveQuality
Subjective Quality estimation structure Each estimation is given in normalized [0, 1] range. Parameter meanings:
Definition: ISubjectiveQualityEstimator.h:33
IObject.h
Object system types and interfaces.
FSDKError.h
Common SDK error codes.
fsdk::IRefCounted
Base strong reference counted object interface.
Definition: IRefCounted.h:37
fsdk::ISubjectiveQualityEstimator::estimate
virtual Result< FSDKError > estimate(const Image &warp, SubjectiveQuality &quality) const noexcept=0
Estimate the quality.
fsdk::ISubjectiveQualityEstimator
Image quality estimator interface.
Definition: ISubjectiveQualityEstimator.h:65
fsdk::Image
Image.
Definition: Image.h:38
fsdk::SubjectiveQuality::isGood
bool isGood() const noexcept
Definition: ISubjectiveQualityEstimator.h:106
fsdk::ISubjectiveQualityEstimator::validate
virtual Result< FSDKError > validate(Span< const Image > warps, Span< Result< FSDKError >> errors) const noexcept=0
Validate input of multiple frames in a single function call.
fsdk::Span
Span. Not owning data view. It incapsulated pointer to the continuous array with one or more T objec...
Definition: Span.h:14