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

Loading...
Searching...
No Matches
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
fsdk::Span
Span. @detail Not owning data view. It incapsulated pointer to the continuous array with one or more ...
Definition Span.h:14
DECLARE_SMARTPTR
#define DECLARE_SMARTPTR(X)
Smart ptr declaration helper macro.
Definition Def.h:56
fsdk::SubjectiveQuality::isGood
bool isGood() const noexcept
Definition ISubjectiveQualityEstimator.h:106
fsdk
SDK namespace.
Definition IAGSEstimator.h:8
fsdk::IRefCounted
Base strong reference counted object interface.
Definition IRefCounted.h:37
fsdk::ISubjectiveQualityEstimator
Image quality estimator interface.
Definition ISubjectiveQualityEstimator.h:65
fsdk::ISubjectiveQualityEstimator::estimate
virtual Result< FSDKError > estimate(Span< const Image > warps, Span< SubjectiveQuality > quality) const noexcept=0
Estimate the subjective quality of multiple warped images in a single estimate function call.
fsdk::ISubjectiveQualityEstimator::estimate
virtual Result< FSDKError > estimate(const Image &warp, SubjectiveQuality &quality) const noexcept=0
Estimate the quality.
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::Image
Image.
Definition Image.h:38
fsdk::Result
A structure that encapsulates an action result enumeration.
Definition Result.h:27
fsdk::SubjectiveQuality
Subjective Quality estimation structure Each estimation is given in normalized [0,...
Definition ISubjectiveQualityEstimator.h:33