-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathface_recognition.h
executable file
·80 lines (70 loc) · 1.79 KB
/
face_recognition.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//
// Created by scaled
//
#define DLIB_THREAD_SIGNAL_NONE 0
#define DLIB_THREAD_SIGNAL_RESET 1
#define DLIB_THREAD_SIGNAL_CALIBRATE_MTH_Neutral 2
#define DLIB_THREAD_SIGNAL_CALIBRATE_MTH_E 3
#define DLIB_THREAD_SIGNAL_CALIBRATE_MTH_A 4
#define DLIB_THREAD_SIGNAL_CALIBRATE_MTH_Fun 5
#define DLIB_THREAD_SIGNAL_CALIBRATE_MTH_U 6
#define HEVA_CONFIG_PATH "heva.ini"
#include <pthread.h>
#include <dlib/opencv.h>
#include <dlib/image_processing.h>
#include <dlib/image_processing/frontal_face_detector.h>
struct face_recognition_data {
double MTH_A;
double MTH_U;
double MTH_Fun;
double MTH_E;
double MTH_LeftRight;
double BRW_Fun;
double BRW_Angry;
double EYE_Close_L;
double EYE_Close_R;
double rotation1;
double rotation2;
double rotation3;
double translation1;
double translation2;
double translation3;
};
struct webcam_settings_t {
int Width = -1;
int Height = -1;
int Fps = -1;
bool Setup = true;
bool YUYV = false;
bool LimitTo24or25 = false;
char PreferredName[256] = "";
int PreferredId = -1;
char Format[4] = "";
bool Sync = true;
bool SyncType2 = true;
bool MouthIndirect = false;
float Gamma = 1.0;
int Buffer = -1;
bool EyeSync = true;
char shapePredictorPath[256] = "";
};
struct dlib_thread_data {
unsigned char dlib_thread_active;
unsigned char dlib_thread_ready;
unsigned char dlib_thread_signal;
pthread_cond_t dlib_thread_cond;
face_recognition_data face_data;
webcam_settings_t* webcam_settings;
pthread_cond_t dlib_thread2_cond1;
pthread_cond_t dlib_thread2_cond2;
dlib::cv_image<unsigned char> cimg;
bool facesFound;
bool faceTracked;
dlib::correlation_tracker tracker;
double tracker_reference_psr;
dlib::point faceCenter;
dlib::rectangle faceRect;
bool thread1_waiting;
};
void* dlib_thread1_function(void* data);
void* dlib_thread2_function(void* data);