BestShotMobile
Bestshot making and liveness checking library
 All Classes Functions Variables
IBestShotMobile.h
1 #pragma once
2 
3 #include "BestShotMobileDefs.h"
4 
5 #include <fsdk/FaceEngine.h>
6 #if BESTSHOT_MOBILE_IOS_PLATFORM
7  #include <tsdk/ITrackEngine.h>
8 #else
9  #include <trackEngine/ITrackEngine.h>
10 #endif
11 
12 namespace mobile {
13 
17  enum class LivenessType {
18  None = 0,
19  Online = 1,
20  Offline = 2
21  };
22 
25  enum class LivenessState {
26  Alive,
27  Fake,
28  None,
29  NotReady,
30  BadHeadPose,
31  BadQuality,
32  FaceNotFound,
33  FaceTooClose,
34  FaceCloseToBorder,
35  FaceTooSmall,
36  TooManyFaces,
37  Timeout,
38  CriticalError
39  };
40 
43  enum class BestShotState {
44  Ok,
45  BadQuality,
46  BadHeadPose,
47  Error
48  };
49 
50  struct BestShotInfo {
52  BestShotState state;
53 
55  fsdk::Image image;
57  fsdk::Detection detection;
59  fsdk::Landmarks5 landmarks;
60 
63  fsdk::HeadPoseEstimation headPoseEstimation;
67 
69  tsdk::FrameId frameIndex;
71  tsdk::TrackId trackId;
72  };
73 
81  BESTSHOT_MOBILE_API virtual void bestShot(
82  const BestShotInfo& bestShotInfo) = 0;
83 
90  BESTSHOT_MOBILE_API virtual void liveness(
91  const LivenessState livenessState,
92  const BestShotInfo& bestShotInfo) = 0;
93 
98  BESTSHOT_MOBILE_API virtual void trackEnd(
99  const tsdk::TrackId& trackId) = 0;
100  };
101 
106 
107  virtual ~IBestShotMobile() = default;
108 
123  BESTSHOT_MOBILE_API virtual bool pushFrame(
124  const fsdk::Image &frame,
125  uint32_t frameId) = 0;
126 
130  BESTSHOT_MOBILE_API virtual void setBestShotMobileObserver(
131  IBestShotMobileObserver* observer) = 0;
132 
139  BESTSHOT_MOBILE_API virtual void join() = 0;
140 
145  BESTSHOT_MOBILE_API virtual LivenessType getLivenessType() = 0;
146  };
147 
154  BESTSHOT_MOBILE_API IBestShotMobile* createBestShotMobile(
155  fsdk::FaceEngineType* faceEngine,
156  tsdk::ITrackEngine* trackEngine,
157  fsdk::ISettingsProvider* settings
158  );
159 
166  BESTSHOT_MOBILE_API IBestShotMobile* createBestShotMobile(
167  fsdk::FaceEngineType* faceEngine,
168  tsdk::ITrackEngine* trackEngine,
169  const char * configPath
170  );
171 
172 } // namespace mobile
fsdk::Landmarks5 landmarks
Face landmarks.
Definition: IBestShotMobile.h:59
virtual BESTSHOT_MOBILE_API void setBestShotMobileObserver(IBestShotMobileObserver *observer)=0
Sets a bestshot observer.
fsdk::Detection detection
Detection with face.
Definition: IBestShotMobile.h:57
virtual BESTSHOT_MOBILE_API void bestShot(const BestShotInfo &bestShotInfo)=0
Bestshot notification.
tsdk::TrackId trackId
Index of the track.
Definition: IBestShotMobile.h:71
virtual BESTSHOT_MOBILE_API LivenessType getLivenessType()=0
Returns current liveness type.
virtual BESTSHOT_MOBILE_API void trackEnd(const tsdk::TrackId &trackId)=0
End of a track notification.
tsdk::FrameId frameIndex
Index of the frame.
Definition: IBestShotMobile.h:69
fsdk::HeadPoseEstimation headPoseEstimation
Definition: IBestShotMobile.h:63
BestShotState state
State of this frame.
Definition: IBestShotMobile.h:52
virtual BESTSHOT_MOBILE_API bool pushFrame(const fsdk::Image &frame, uint32_t frameId)=0
Pushes a single frame to the buffer.
virtual BESTSHOT_MOBILE_API void liveness(const LivenessState livenessState, const BestShotInfo &bestShotInfo)=0
Liveness check notification.
IBestShotMobile interface class.
Definition: IBestShotMobile.h:105
Definition: IBestShotMobile.h:74
float agsEstimation
Definition: IBestShotMobile.h:66
Definition: IBestShotMobile.h:50
virtual BESTSHOT_MOBILE_API void join()=0
Blocks current thread until all frames in this Stream will be handled and all callbacks will be execu...
fsdk::Image image
Source image.
Definition: IBestShotMobile.h:55