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

IWarper.h
Go to the documentation of this file.
1
8 #pragma once
9
10 #include <fsdk/IDescriptor.h>
11 #include <fsdk/Types/Span.h>
12
13 #include <fsdk/vlc/future.h>
14
15 namespace fsdk {
16 struct EyesEstimation;
17 struct GazeEstimation;
18 }
19
20 namespace fsdk {
21
22 #ifndef DOXYGEN_SHOULD_SKIP_THIS
23 DECLARE_SMARTPTR(IWarper);
24 #endif
25
31 struct Transformation {
32 Vector2<float> centerP = {0, 0}; //From 0, scaled
33 float angleDeg = 0;
34 float scale = 0;
35 Vector2<int> detectionTopLeft = {0, 0}; //From 0, original size
36
37 bool isValid = false;
38 };
39
44 struct IWarper : IRefCounted {
52 virtual Transformation
53 createTransformation(
54 const Detection& detection,
55 const Landmarks5& landmarks) const noexcept = 0;
56
66 virtual Result<FSDKError>
67 warp(
68 const Image& image,
69 const Transformation& transformation,
70 Image& transformedImage) const noexcept = 0;
71
91 virtual Result<FSDKError>
92 warp(
93 Span<const Image> images,
94 Span<const Transformation> transformations,
95 Span<Image> transformedImages) const noexcept = 0;
96
107 virtual Result<FSDKError>
108 warp(
109 const Landmarks5& landmarks,
110 const Transformation& transformation,
111 Landmarks5& transformedLandmarks) const noexcept = 0;
112
123 virtual Result<FSDKError>
124 warp(
125 const Landmarks68& landmarks68,
126 const Transformation& transformation,
127 Landmarks68& transformedLandmarks68) const noexcept = 0;
128
140 virtual Result<FSDKError>
141 unwarp(
142 const EyesEstimation& eyesEstimationInWarpCoordinates,
143 const Transformation& transformation,
144 EyesEstimation& eyesEstimation) const noexcept = 0;
145
154 virtual Result<FSDKError>
155 unwarp(
156 const Landmarks5& warpedLandmarks5,
157 const Transformation& transformation,
158 Landmarks5& landmarks5) const noexcept = 0;
159
168 virtual Result<FSDKError>
169 unwarp(
170 const Landmarks68& warpedLandmarks68,
171 const Transformation& transformation,
172 Landmarks68& landmarks68) const noexcept = 0;
173
174 virtual Result<FSDKError>
175 unwarp(
176 const GazeEstimation& warpedAngles,
177 const Transformation& transformation,
178 GazeEstimation& angles
179 ) const noexcept = 0;
180
184 using ImageBatch = std::vector<Image>;
185 using ImageBatchFuture = vlc::future<ImageBatch>;
186
199 virtual ImageBatchFuture warpAsync(
200 Span<const Image> images,
201 Span<const Transformation> transformations) const = 0;
202 };
203
204 }
fsdk::Transformation
Transformation data structure, used for warping.
Definition: IWarper.h:31
DECLARE_SMARTPTR
#define DECLARE_SMARTPTR(X)
Smart ptr declaration helper macro.
Definition: Def.h:59
fsdk
SDK namespace.
Definition: IAGSEstimator.h:8
fsdk::Result
A structure that encapsulates an action result enumeration.
Definition: Result.h:29
fsdk::Landmarks
Face landmarks template structure.
Definition: Landmarks.h:21
fsdk::IWarper
Face detection area warper interface.
Definition: IWarper.h:44
fsdk::EyesEstimation
Eyes estimation output.
Definition: IEyeEstimator.h:18
fsdk::IRefCounted
Base strong reference counted object interface.
Definition: IRefCounted.h:36
fsdk::IWarper::createTransformation
virtual Transformation createTransformation(const Detection &detection, const Landmarks5 &landmarks) const noexcept=0
Create transformation data struct.
fsdk::IWarper::unwarp
virtual Result< FSDKError > unwarp(const EyesEstimation &eyesEstimationInWarpCoordinates, const Transformation &transformation, EyesEstimation &eyesEstimation) const noexcept=0
Warp irisLandmarks in EyesEstimation struct for both eyes.
IDescriptor.h
Descriptor extractor and matcher interfaces.
fsdk::IWarper::warp
virtual Result< FSDKError > warp(const Image &image, const Transformation &transformation, Image &transformedImage) const noexcept=0
Warp image.
fsdk::GazeEstimation
Gaze estimation output.
Definition: IGazeEstimator.h:19
fsdk::Image
Image.
Definition: Image.h:38
fsdk::IWarper::warpAsync
virtual ImageBatchFuture warpAsync(Span< const Image > images, Span< const Transformation > transformations) const =0
Asynchronously warp faces on multiple images.
fsdk::IWarper::ImageBatch
std::vector< Image > ImageBatch
Common aliases for IWarper asynchronous interface.
Definition: IWarper.h:184
fsdk::Detection
Detection structure. Stores a detected bounding box within a source image rect.
Definition: Detection.h:10
fsdk::Span
Span. Not owning data view. It incapsulated pointer to the continuous array with one or more T objec...
Definition: Span.h:14
fsdk::Vector2< float >