Face Engine SDK  5.14.0
A face detection, recognition and tracking engine.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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 
37  struct Transformation {
38  Vector2<float> centerP = {0, 0}; //From 0, scaled
39  float angleDeg = 0;
40  float scale = 0;
41  Vector2<int> detectionTopLeft = {0, 0}; //From 0, original size
42 
43  bool isValid = false;
44  };
45 
50  struct IWarper : IRefCounted {
58  virtual Transformation
60  const Detection& detection,
61  const Landmarks5& landmarks) const noexcept = 0;
62 
72  virtual Result<FSDKError>
73  warp(
74  const Image& image,
75  const Transformation& transformation,
76  Image& transformedImage) const noexcept = 0;
77 
95  virtual Result<FSDKError>
96  warp(
97  Span<const Image> images,
98  Span<const Transformation> transformations,
99  Span<Image> transformedImages) const noexcept = 0;
100 
111  virtual Result<FSDKError>
112  warp(
113  const Landmarks5& landmarks,
114  const Transformation& transformation,
115  Landmarks5& transformedLandmarks) const noexcept = 0;
116 
127  virtual Result<FSDKError>
128  warp(
129  const Landmarks68& landmarks68,
130  const Transformation& transformation,
131  Landmarks68& transformedLandmarks68) const noexcept = 0;
132 
144  virtual Result<FSDKError>
145  unwarp(
146  const EyesEstimation& eyesEstimationInWarpCoordinates,
147  const Transformation& transformation,
148  EyesEstimation& eyesEstimation) const noexcept = 0;
149 
158  virtual Result<FSDKError>
159  unwarp(
160  const Landmarks5& warpedLandmarks5,
161  const Transformation& transformation,
162  Landmarks5& landmarks5) const noexcept = 0;
163 
172  virtual Result<FSDKError>
173  unwarp(
174  const Landmarks68& warpedLandmarks68,
175  const Transformation& transformation,
176  Landmarks68& landmarks68) const noexcept = 0;
177 
178  virtual Result<FSDKError>
179  unwarp(
180  const GazeEstimation& warpedAngles,
181  const Transformation& transformation,
182  GazeEstimation& angles
183  ) const noexcept = 0;
184 
188  using ImageBatch = std::vector<Image>;
189  using ImageBatchFuture = vlc::future<ImageBatch>;
190 
203  virtual ImageBatchFuture warpAsync(
204  Span<const Image> images,
205  Span<const Transformation> transformations) const = 0;
206  };
208 }
Transformation data structure, used for warping.
Definition: IWarper.h:37
#define DECLARE_SMARTPTR(X)
Smart ptr declaration helper macro.
Definition: Def.h:59
A structure that encapsulates an action result enumeration.
Definition: Result.h:29
Face landmarks template structure.
Definition: Landmarks.h:21
Face detection area warper interface.
Definition: IWarper.h:50
Eyes estimation output.
Definition: IEyeEstimator.h:23
Base strong reference counted object interface.
Definition: IRefCounted.h:36
virtual Transformation createTransformation(const Detection &detection, const Landmarks5 &landmarks) const noexcept=0
Create transformation data struct.
virtual Result< FSDKError > unwarp(const EyesEstimation &eyesEstimationInWarpCoordinates, const Transformation &transformation, EyesEstimation &eyesEstimation) const noexcept=0
Warp irisLandmarks in EyesEstimation struct for both eyes.
Descriptor extractor and matcher interfaces.
virtual Result< FSDKError > warp(const Image &image, const Transformation &transformation, Image &transformedImage) const noexcept=0
Warp image.
Gaze estimation output.
Definition: IGazeEstimator.h:25
Image.
Definition: Image.h:39
virtual ImageBatchFuture warpAsync(Span< const Image > images, Span< const Transformation > transformations) const =0
Asynchronously warp faces on multiple images.
std::vector< Image > ImageBatch
Common aliases for IWarper asynchronous interface.
Definition: IWarper.h:188
Detection structure. Stores a detected bounding box within a source image rect.
Definition: Detection.h:10
Span. Not owning data view. It incapsulated pointer to the continuous array with one or more T objec...
Definition: Span.h:14