Face Engine SDK  4.6.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 
12 namespace fsdk {
13  struct EyesEstimation;
14  struct GazeEstimation;
15 }
16 
17 namespace fsdk {
18 
19 #ifndef DOXYGEN_SHOULD_SKIP_THIS
20  DECLARE_SMARTPTR(IWarper);
21 #endif
22 
28  struct Transformation {
29  Vector2<float> centerP = {0, 0}; //From 0, scaled
30  float angleDeg = 0;
31  float scale = 0;
32  Vector2<int> detectionTopLeft = {0, 0}; //From 0, original size
33 
34  bool isValid = false;
35  };
36 
41  struct IWarper : IRefCounted {
47  virtual Transformation
49  const Detection& detection,
50  const Landmarks5& landmarks) const noexcept = 0;
51 
59  virtual Result<FSDKError>
60  warp(
61  const Image& image,
62  const Transformation& transformation,
63  Image& transformedImage) const noexcept = 0;
64 
74  virtual Result<FSDKError>
75  warp(
76  const Landmarks5& landmarks,
77  const Transformation& transformation,
78  Landmarks5& transformedLandmarks) const noexcept = 0;
79 
89  virtual Result<FSDKError>
90  warp(
91  const Landmarks68& landmarks68,
92  const Transformation& transformation,
93  Landmarks68& transformedLandmarks68) const noexcept = 0;
94 
104  virtual Result<FSDKError>
105  unwarp(
106  const EyesEstimation& eyesEstimationInWarpCoordinates,
107  const Transformation& transformation,
108  EyesEstimation& eyesEstimation) const noexcept = 0;
109 
117  virtual Result<FSDKError>
118  unwarp(
119  const Landmarks5& warpedLandmarks5,
120  const Transformation& transformation,
121  Landmarks5& landmarks5) const noexcept = 0;
122 
130  virtual Result<FSDKError>
131  unwarp(
132  const Landmarks68& warpedLandmarks68,
133  const Transformation& transformation,
134  Landmarks68& landmarks68) const noexcept = 0;
135 
137  unwarp(
138  const fsdk::GazeEstimation& warpedAngles,
139  const Transformation& transformation,
140  fsdk::GazeEstimation& angles
141  ) const noexcept = 0;
142  };
143 
144 }
Transformation data structure, used for warping.
Definition: IWarper.h:28
#define DECLARE_SMARTPTR(X)
Smart ptr declaration helper macro.
Definition: Def.h:59
Face landmarks template structure.
Definition: Landmarks.h:18
Face detection area warper interface.
Definition: IWarper.h:41
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:37
Face detection. Stores a detected face bounding box within a source image frame as well as detection...
Definition: Detection.h:10