Face Engine SDK  5.5.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 "IDescriptor.h"
11 #include <fsdk/Types/Span.h>
12 
13 namespace fsdk {
14  struct EyesEstimation;
15  struct GazeEstimation;
16 }
17 
18 namespace fsdk {
19 
20 #ifndef DOXYGEN_SHOULD_SKIP_THIS
21  DECLARE_SMARTPTR(IWarper);
22 #endif
23 
29  struct Transformation {
30  Vector2<float> centerP = {0, 0}; //From 0, scaled
31  float angleDeg = 0;
32  float scale = 0;
33  Vector2<int> detectionTopLeft = {0, 0}; //From 0, original size
34 
35  bool isValid = false;
36  };
37 
42  struct IWarper : IRefCounted {
48  virtual Transformation
50  const Detection& detection,
51  const Landmarks5& landmarks) const noexcept = 0;
52 
60  virtual Result<FSDKError>
61  warp(
62  const Image& image,
63  const Transformation& transformation,
64  Image& transformedImage) const noexcept = 0;
65 
82  virtual Result<FSDKError>
83  warp(
84  Span<const Image> images,
85  Span<const Transformation> transformations,
86  Span<Image> transformedImages) const noexcept = 0;
87 
97  virtual Result<FSDKError>
98  warp(
99  const Landmarks5& landmarks,
100  const Transformation& transformation,
101  Landmarks5& transformedLandmarks) const noexcept = 0;
102 
112  virtual Result<FSDKError>
113  warp(
114  const Landmarks68& landmarks68,
115  const Transformation& transformation,
116  Landmarks68& transformedLandmarks68) const noexcept = 0;
117 
127  virtual Result<FSDKError>
128  unwarp(
129  const EyesEstimation& eyesEstimationInWarpCoordinates,
130  const Transformation& transformation,
131  EyesEstimation& eyesEstimation) const noexcept = 0;
132 
140  virtual Result<FSDKError>
141  unwarp(
142  const Landmarks5& warpedLandmarks5,
143  const Transformation& transformation,
144  Landmarks5& landmarks5) const noexcept = 0;
145 
153  virtual Result<FSDKError>
154  unwarp(
155  const Landmarks68& warpedLandmarks68,
156  const Transformation& transformation,
157  Landmarks68& landmarks68) const noexcept = 0;
158 
160  unwarp(
161  const fsdk::GazeEstimation& warpedAngles,
162  const Transformation& transformation,
163  fsdk::GazeEstimation& angles
164  ) const noexcept = 0;
165  };
166 
167 }
Transformation data structure, used for warping.
Definition: IWarper.h:29
#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:20
Face detection area warper interface.
Definition: IWarper.h:42
Eyes estimation output.
Definition: IEyeEstimator.h:18
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.
Image.
Definition: Image.h:38
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