| BestShotMobile Bestshot making and liveness checking library

- Main Page
- Classes
- Files

- File List

All Classes Functions Variables
IBestShotMobile.h
1 #pragma once
2
3 #include "BestShotMobileDefs.h"
4
5 #include <fsdk/FaceEngine.h>
6 #include <tsdk/ITrackEngine.h>
7
8 namespace mobile {
9
13 enum class LivenessType {
14 None = 0,
15 Online = 1,
16 Offline = 2
17 };
18
21 enum class LivenessState {
22 Alive,
23 Fake,
24 None,
25 NotReady,
26 BadHeadPose,
27 BadQuality,
28 FaceNotFound,
29 FaceTooClose,
30 FaceCloseToBorder,
31 FaceTooSmall,
32 TooManyFaces,
33 Timeout,
34 CriticalError
35 };
36
39 enum class BestShotState {
40 Ok,
41 BadQuality,
42 BadHeadPose,
43 Error
44 };
45
46 struct BestShotInfo {
48 BestShotState state;
49
51 fsdk::Image image;
53 fsdk::Detection detection;
55 fsdk::Landmarks5 landmarks;
56
59 fsdk::HeadPoseEstimation headPoseEstimation;
62 float agsEstimation;
63
65 tsdk::FrameId frameIndex;
67 tsdk::TrackId trackId;
68 };
69
70 struct IBestShotMobileObserver {
77 BESTSHOT_MOBILE_API virtual void bestShot(
78 const BestShotInfo& bestShotInfo) = 0;
79
86 BESTSHOT_MOBILE_API virtual void liveness(
87 const LivenessState livenessState,
88 const BestShotInfo& bestShotInfo) = 0;
89
94 BESTSHOT_MOBILE_API virtual void trackEnd(
95 const tsdk::TrackId& trackId) = 0;
96 };
97
101 struct IBestShotMobile {
102
103 virtual ~IBestShotMobile() = default;
104
119 BESTSHOT_MOBILE_API virtual bool pushFrame(
120 const fsdk::Image &frame,
121 uint32_t frameId) = 0;
122
126 BESTSHOT_MOBILE_API virtual void setBestShotMobileObserver(
127 IBestShotMobileObserver* observer) = 0;
128
135 BESTSHOT_MOBILE_API virtual void join() = 0;
136
141 BESTSHOT_MOBILE_API virtual LivenessType getLivenessType() = 0;
142 };
143
150 IBestShotMobile* createBestShotMobile(
151 fsdk::FaceEngineType* faceEngine,
152 tsdk::ITrackEngine* trackEngine,
153 fsdk::ISettingsProvider* settings
154 );
155
162 IBestShotMobile* createBestShotMobile(
163 fsdk::FaceEngineType* faceEngine,
164 tsdk::ITrackEngine* trackEngine,
165 const char * configPath
166 );
167
168 } // namespace mobile
mobile::BestShotInfo::landmarks
fsdk::Landmarks5 landmarks
Face landmarks.
Definition: IBestShotMobile.h:55
mobile::IBestShotMobile::setBestShotMobileObserver
virtual BESTSHOT_MOBILE_API void setBestShotMobileObserver(IBestShotMobileObserver *observer)=0
Sets a bestshot observer.
mobile::BestShotInfo::detection
fsdk::Detection detection
Detection with face.
Definition: IBestShotMobile.h:53
mobile::IBestShotMobileObserver::bestShot
virtual BESTSHOT_MOBILE_API void bestShot(const BestShotInfo &bestShotInfo)=0
Bestshot notification.
mobile::BestShotInfo::trackId
tsdk::TrackId trackId
Index of the track.
Definition: IBestShotMobile.h:67
mobile::IBestShotMobile::getLivenessType
virtual BESTSHOT_MOBILE_API LivenessType getLivenessType()=0
Returns current liveness type.
mobile::IBestShotMobileObserver::trackEnd
virtual BESTSHOT_MOBILE_API void trackEnd(const tsdk::TrackId &trackId)=0
End of a track notification.
mobile::BestShotInfo::frameIndex
tsdk::FrameId frameIndex
Index of the frame.
Definition: IBestShotMobile.h:65
mobile::BestShotInfo::headPoseEstimation
fsdk::HeadPoseEstimation headPoseEstimation
Definition: IBestShotMobile.h:59
mobile::BestShotInfo::state
BestShotState state
State of this frame.
Definition: IBestShotMobile.h:48
mobile::IBestShotMobile::pushFrame
virtual BESTSHOT_MOBILE_API bool pushFrame(const fsdk::Image &frame, uint32_t frameId)=0
Pushes a single frame to the buffer.
mobile::IBestShotMobileObserver::liveness
virtual BESTSHOT_MOBILE_API void liveness(const LivenessState livenessState, const BestShotInfo &bestShotInfo)=0
Liveness check notification.
mobile::IBestShotMobile
IBestShotMobile interface class.
Definition: IBestShotMobile.h:101
mobile::IBestShotMobileObserver
Definition: IBestShotMobile.h:70
mobile::BestShotInfo::agsEstimation
float agsEstimation
Definition: IBestShotMobile.h:62
mobile::BestShotInfo
Definition: IBestShotMobile.h:46
mobile::IBestShotMobile::join
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...
mobile::BestShotInfo::image
fsdk::Image image
Source image.
Definition: IBestShotMobile.h:51