-
Notifications
You must be signed in to change notification settings - Fork 0
/
fer.h
52 lines (41 loc) · 1.15 KB
/
fer.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
#pragma once
#include <vector>
#include <algorithm>
#include <dlib/opencv.h>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/ml/ml.hpp>
#include <dlib/image_processing/frontal_face_detector.h>
#include <dlib/image_processing/render_face_detections.h>
#include <dlib/image_processing.h>
//#include <direct.h>
// using namespace dlib;
// using namespace std;
class FER
{
private:
dlib::frontal_face_detector FaceDetector;
dlib::shape_predictor pose_model;
unsigned short NotFoundCount;
unsigned int FaceDetectNormalizedW;
unsigned int FaceDetectCommonFscale;
cv::Rect SearchROI;
std::vector<float> get_features(cv::Mat submat, int row_ratio, int col_ratio);
public:
unsigned int IMG_WIDTH;
unsigned int IMG_HEIGHT;
char usrname;
cv::Rect FaceROI;
dlib::full_object_detection faceshape;
FER();
~FER();
cv::Rect face_detect(cv::Mat SearchArea);
cv::Rect face_detect_all(cv::Mat SearchArea);
cv::Mat face_alignment(cv::Mat gray);
// cv::Mat face_rotate();
cv::Mat feat_extract(cv::Mat &face);
// fer_train();
// fer_predict();
};