-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathface_def.hpp
More file actions
43 lines (36 loc) · 847 Bytes
/
face_def.hpp
File metadata and controls
43 lines (36 loc) · 847 Bytes
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
#ifndef FACE_DEF_HPP
#define FACE_DEF_HPP
#pragma once
#include "opencv2/opencv.hpp"
// center: [x, y], width: w, height: h
typedef struct BndBox_xywh {
cv::Point2f center;
float w;
float h;
} BndBox_xywh;
// top_left: [x1, y1], bottom_right: [x2, y2]
typedef struct BndBox_xyxy {
cv::Point2f top_left;
cv::Point2f bottom_right;
float area() {
return (bottom_right.x - top_left.x + 1) * (bottom_right.y - top_left.y + 1);
}
} BndBox_xyxy;
typedef struct Landmarks_5 {
// right eye
cv::Point2f right_eye;
// left eye
cv::Point2f left_eye;
// mouth left
cv::Point2f mouth_left;
// nose
cv::Point2f nose_tip;
// mouth right
cv::Point2f mouth_right;
} Landmarks_5;
typedef struct Face {
BndBox_xyxy bbox;
Landmarks_5 landmarks;
float score;
} Face;
#endif