Face Engine SDK  5.6.0
A face detection, recognition and tracking engine.
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 {
50  virtual Transformation
52  const Detection& detection,
53  const Landmarks5& landmarks) const noexcept = 0;
54 
64  virtual Result<FSDKError>
66  const Image& image,
67  const Transformation& transformation,
68  Image& transformedImage) const noexcept = 0;
69 
89  virtual Result<FSDKError>
91  Span<const Image> images,
92  Span<const Transformation> transformations,
93  Span<Image> transformedImages) const noexcept = 0;
94 
105  virtual Result<FSDKError>
107  const Landmarks5& landmarks,
108  const Transformation& transformation,
109  Landmarks5& transformedLandmarks) const noexcept = 0;
110 
121  virtual Result<FSDKError>
123  const Landmarks68& landmarks68,
124  const Transformation& transformation,
125  Landmarks68& transformedLandmarks68) const noexcept = 0;
126 
138  virtual Result<FSDKError>
140  const EyesEstimation& eyesEstimationInWarpCoordinates,
141  const Transformation& transformation,
142  EyesEstimation& eyesEstimation) const noexcept = 0;
143 
152  virtual Result<FSDKError>
154  const Landmarks5& warpedLandmarks5,
155  const Transformation& transformation,
156  Landmarks5& landmarks5) const noexcept = 0;
157 
166  virtual Result<FSDKError>
168  const Landmarks68& warpedLandmarks68,
169  const Transformation& transformation,
170  Landmarks68& landmarks68) const noexcept = 0;
171 
172  virtual Result<FSDKError>
173  unwarp(
174  const GazeEstimation& warpedAngles,
175  const Transformation& transformation,
176  GazeEstimation& angles
177  ) const noexcept = 0;
178  };
179 
180 }
fsdk::Span
Span. @detail Not owning data view. It incapsulated pointer to the continuous array with one or more ...
Definition: Span.h:15
fsdk::IWarper::warp
virtual Result< FSDKError > warp(const Image &image, const Transformation &transformation, Image &transformedImage) const noexcept=0
Warp image.
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.
DECLARE_SMARTPTR
#define DECLARE_SMARTPTR(X)
Smart ptr declaration helper macro.
Definition: Def.h:59
fsdk::IWarper::unwarp
virtual Result< FSDKError > unwarp(const Landmarks5 &warpedLandmarks5, const Transformation &transformation, Landmarks5 &landmarks5) const noexcept=0
Warp landmarks of size 5 back to source image coordinates.
fsdk::IWarper
Face detection area warper interface.
Definition: IWarper.h:42
fsdk::Vector2< float >
fsdk::IWarper::warp
virtual Result< FSDKError > warp(Span< const Image > images, Span< const Transformation > transformations, Span< Image > transformedImages) const noexcept=0
Warp faces on multiple images.
fsdk
SDK namespace.
Definition: IAGSEstimator.h:8
fsdk::Landmarks
Face landmarks template structure.
Definition: Landmarks.h:20
fsdk::IWarper::createTransformation
virtual Transformation createTransformation(const Detection &detection, const Landmarks5 &landmarks) const noexcept=0
Create transformation data struct.
fsdk::Detection
Detection structure. @detail Stores a detected bounding box within a source image rect.
Definition: Detection.h:10
fsdk::Result
A structure that encapsulates an action result enumeration.
Definition: Result.h:30
fsdk::EyesEstimation
Eyes estimation output.
Definition: IEyeEstimator.h:18
fsdk::Image
Image.
Definition: Image.h:38
fsdk::IWarper::unwarp
virtual Result< FSDKError > unwarp(const Landmarks68 &warpedLandmarks68, const Transformation &transformation, Landmarks68 &landmarks68) const noexcept=0
Warp landmarks of size 68 back to source image coordinates.
fsdk::Transformation
Transformation data structure, used for warping.
Definition: IWarper.h:29
fsdk::IRefCounted
Base strong reference counted object interface.
Definition: IRefCounted.h:36
fsdk::IWarper::warp
virtual Result< FSDKError > warp(const Landmarks5 &landmarks, const Transformation &transformation, Landmarks5 &transformedLandmarks) const noexcept=0
Warp landmarks of size 5.
fsdk::IWarper::warp
virtual Result< FSDKError > warp(const Landmarks68 &landmarks68, const Transformation &transformation, Landmarks68 &transformedLandmarks68) const noexcept=0
Warp landmarks of size 68.
IDescriptor.h
Descriptor extractor and matcher interfaces.