DFace SDK  2.0.0
LTM
types.h
1 //
2 // Created by asy on 10/16/18.
3 //
4 
5 #ifndef DFACE_TYPES_H
6 #define DFACE_TYPES_H
7 #include <vector>
8 #include "def.h"
9 
10 namespace dface {
11  using namespace std;
12 
16  struct Box {
17  int x;
18  int y;
19  int w;
20  int h;
21  float score;
22  short int id;
23  unsigned char type;
24  float point[10];
25  int age;
26  void* raw;
27  };
28 
32  struct Point {
33  int x;
34  int y;
35  };
36 
40  struct Rect {
41  int x;
42  int y;
43  int w;
44  int h;
45  };
46 
50  struct Size {
51  int w;
52  int h;
53  };
54 
55 
62  static inline dface::Rect Box2Rect(dface::Box in_box){
63  dface::Rect ret;
64  ret.x = in_box.x;
65  ret.y = in_box.y;
66  ret.w = in_box.w;
67  ret.h = in_box.h;
68  return ret;
69  }
70 
71 
79  static inline void Box2RectMuti(std::vector<dface::Box> &in_boxs, std::vector<dface::Rect> &out_rects){
80  for(int i=0; i<in_boxs.size(); ++i){
81  dface::Rect rect = Box2Rect(in_boxs.at(i));
82  out_rects.push_back(rect);
83  }
84  }
85 
86 
93  static inline Box Rect2Box(dface::Rect &in_rect){
94  dface::Box ret;
95  ret.x = in_rect.x;
96  ret.y = in_rect.y;
97  ret.w = in_rect.w;
98  ret.h = in_rect.h;
99  return ret;
100  }
101 
102 
110  static inline void Rect2BoxMuti(std::vector<dface::Rect> &in_rects, std::vector<dface::Box> &out_boxs){
111  for(int i=0; i<in_rects.size(); ++i){
112  dface::Box box = Rect2Box(in_rects.at(i));
113  out_boxs.push_back(box);
114  }
115  }
116 
117 
118 }
119 
120 
121 #endif //DFACE_TYPES_H
int y
Definition: types.h:34
Definition: allocator.h:14
int w
Definition: types.h:43
int w
Definition: types.h:51
Definition: types.h:32
int x
Definition: types.h:17
int age
Definition: types.h:25
int h
Definition: types.h:44
边框信息(人脸,行人,物体等)
Definition: types.h:16
int y
Definition: types.h:18
float score
Definition: types.h:21
尺寸
Definition: types.h:50
矩形
Definition: types.h:40
int x
Definition: types.h:41
int y
Definition: types.h:42
int w
Definition: types.h:19
unsigned char type
Definition: types.h:23
int x
Definition: types.h:33
short int id
Definition: types.h:22
void * raw
Definition: types.h:26
int h
Definition: types.h:52
int h
Definition: types.h:20