visageSDK

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

All Classes Namespaces Functions Variables Enumerations Enumerator Pages
VisageFeaturesDetector.h
1 //
3 // (c) Visage Technologies AB 2002 - 2023 All rights reserved.
4 //
5 // This file is part of visage|SDK(tm).
6 // Unauthorized copying of this file, via any medium is strictly prohibited.
7 //
8 // No warranty, explicit or implicit, provided.
9 //
10 // This is proprietary software. No part of this software may be used or
11 // reproduced in any form or by any means otherwise than in accordance with
12 // any written license granted by Visage Technologies AB.
13 //
15
16
17 #ifndef __VisageFeaturesDetector_h__
18 #define __VisageFeaturesDetector_h__
19
20 #ifdef VISAGE_STATIC
21 #define VISAGE_DECLSPEC
22 #else
23
24 #ifdef VISAGE_EXPORTS
25 #define VISAGE_DECLSPEC __declspec(dllexport)
26 #else
27 #define VISAGE_DECLSPEC __declspec(dllimport)
28 #endif
29
30 #endif
31
32 #include "FaceData.h"
33
34 namespace VNN
35 {
36 class INNRunner;
37 }
38
39 namespace VisageSDK
40 {
41
42 #ifndef ANDROID
43 int VISAGE_DECLSPEC initializeLicenseManager(const char *licenseKeyFileFolder);
44 #endif
45
50 const VISAGE_DECLSPEC char* getVisageSDKVersion(void);
51
52 class VisageDetector;
53 class Candide3Model;
54 class PupilRefiner;
55 class EarsRefiner;
56 class DeepAlignmentRuntime;
57 class VisageConfiguration;
58 class VNNFaceFinder;
59
106 class VISAGE_DECLSPEC VisageFeaturesDetector {
107
108 public:
109
148 VisageFeaturesDetector(const char* detectorConfigFile);
149
152 ~VisageFeaturesDetector();
153
158 bool Initialize();
159
192 int detectFaces(VsImage* frame, VsRect* faces, int maxFaces = 1, float minFaceScale = 0.1f, float maxFaceScale = 1.0f, bool useRefinementStep = true);
193
229 int detectFacialFeatures(VsImage* frame, FaceData* output, int maxFaces = 1, float minFaceScale = 0.1f, float maxFaceScale = 1.0f, bool outputOnly2DFeatures = false);
230
231 bool fitModelToFaceD(FDP *input, FaceData *output, VsImage *frame, float pose[6], bool freezeRot = false, bool freezePos = false);
232
233 bool fitModelToFace(FDP* input, FaceData* output, VsImage * frame, float initYaw);
234
235 Candide3Model* m_model;
236
237 private:
238
239 void calculateFDP(FDP* f, int w, int h, VsMat* vert, bool _3D);
240 void setFDPIndices(FDP* f);
241
242 bool configureDetector();
243
244 bool loadModel(Candide3Model **model_, int modelType);
245
246 VisageDetector* m_detector;
247 PupilRefiner* m_pupilRefiner;
248 EarsRefiner* m_earsRefiner;
249 DeepAlignmentRuntime* m_deepAlignmentRuntime;
250 VisageConfiguration* m_Configuration;
251 VNNFaceFinder* m_faceFinder;
252
253 Candide3Model* m_au_model;
254 Candide3Model* m_mesh_model;
255 bool use_pose_model;
256 bool use_au_model;
257 bool use_mesh_model;
258
259 bool m_initialised;
260
261 char m_detectCfgDirPath[1024];
262 };
263
264 }
265 #endif // __VisageFeaturesDetector_h__
266
VisageSDK::VisageFeaturesDetector
Faces and facial features detector implementation.
Definition: VisageFeaturesDetector.h:106
VisageSDK::VisageConfiguration
VisageConfiguration is a class used to change, apply, load and save configuration parameters used by ...
Definition: VisageConfiguration.h:272
VisageSDK::getVisageSDKVersion
const VISAGE_DECLSPEC char * getVisageSDKVersion(void)
Returns visageSDK version and revision number.
VisageSDK::FaceData
Face data structure, used as container for all face tracking and detection results.
Definition: FaceData.h:259
VisageSDK::FDP
Feature points of a face.
Definition: FDP.h:191
VsImage
Image store container.
Definition: vs_core_types_c.h:460