Face SDK  1.13.0 Mozart release
Face Recognition Software Development Kit
face.h
1 
4 #ifndef FACE_SDK_FACE_H
5 #define FACE_SDK_FACE_H
6 
7 #include <face_sdk_base/export.h>
8 #include <face_sdk_base/image.h>
9 
10 #include <vector>
11 #include <tuple>
12 
13 namespace face_sdk
14 {
15  typedef std::tuple<int32_t, int32_t> landmark;
16  typedef std::vector<landmark> landmark_set;
17 
18  enum landmark_fields
19  {
20  landmark_x = 0,
21  landmark_y = 1
22  };
23 
28  const float UNKNOWN_CONFIDENCE = .0f;
29  const uint32_t UNKNOWN_VERSION = 0;
30 
31 
37  class FACE_SDK_EXPORT face
38  {
39  public:
40  virtual ~face() = default;
41 
44  virtual float confidence() const = 0;
45 
48  virtual int32_t x() const = 0;
49 
52  virtual int32_t y() const = 0;
53 
56  virtual int32_t width() const = 0;
57 
60  virtual int32_t height() const = 0;
61 
64  virtual std::shared_ptr<face_sdk::image> img() const = 0;
65 
68  virtual std::shared_ptr<face_sdk::image> cropped_image() const = 0;
69 
72  virtual bool has_landmarks() const = 0;
73 
76  virtual std::vector< std::tuple<int32_t, int32_t> > landmarks() const = 0;
77 
80  virtual bool is_out_of_bounds_set() const = 0;
81 
85  virtual bool out_of_bounds() const = 0;
86 
89  virtual uint32_t version() const = 0;
90  };
91 
92  typedef std::vector< std::shared_ptr<face_sdk::face> > face_set;
93 
101  std::shared_ptr<face_sdk::face> FACE_SDK_EXPORT make_face(const std::shared_ptr<image> &img);
102 
110  std::shared_ptr<face_sdk::face> FACE_SDK_EXPORT make_face(const std::shared_ptr<image> &img,
111  uint32_t version);
112 
121  std::shared_ptr<face_sdk::face> FACE_SDK_EXPORT make_face(const std::shared_ptr<image> &img,
122  bool out_of_bounds,
123  uint32_t version);
124 
136  std::shared_ptr<face_sdk::face> FACE_SDK_EXPORT make_face(const std::shared_ptr<image> &img,
137  int32_t x, int32_t y, int32_t width, int32_t height,
138  float confidence);
139 
152  std::shared_ptr<face_sdk::face> FACE_SDK_EXPORT make_face(const std::shared_ptr<image> &img,
153  int32_t x, int32_t y, int32_t width, int32_t height,
154  float confidence,
155  uint32_t version);
156 
170  std::shared_ptr<face_sdk::face> FACE_SDK_EXPORT make_face(const std::shared_ptr<image> &img,
171  int32_t x, int32_t y, int32_t width, int32_t height,
172  float confidence,
173  bool out_of_bounds,
174  uint32_t version);
175 
188  std::shared_ptr<face_sdk::face> FACE_SDK_EXPORT make_face(const std::shared_ptr<image> &img,
189  int32_t x, int32_t y, int32_t width, int32_t height,
190  float confidence,
191  const std::vector< std::tuple<int32_t, int32_t> > &landmarks);
192 
206  std::shared_ptr<face_sdk::face> FACE_SDK_EXPORT make_face(const std::shared_ptr<image> &img,
207  int32_t x, int32_t y, int32_t width, int32_t height,
208  float confidence,
209  const std::vector< std::tuple<int32_t, int32_t> > &landmarks,
210  uint32_t version);
211 
226  std::shared_ptr<face_sdk::face> FACE_SDK_EXPORT make_face(const std::shared_ptr<image> &img,
227  int32_t x, int32_t y, int32_t width, int32_t height,
228  float confidence,
229  const std::vector< std::tuple<int32_t, int32_t> > &landmarks,
230  bool out_of_bounds,
231  uint32_t version);
232 
246  std::shared_ptr<face_sdk::face> FACE_SDK_EXPORT make_face(const std::shared_ptr<image> &img,
247  int32_t x, int32_t y, int32_t width, int32_t height,
248  float confidence,
249  const std::vector< std::tuple<int32_t, int32_t> > &landmarks,
250  const std::shared_ptr<image> &cropped_image);
251 
252 
267  std::shared_ptr<face_sdk::face> FACE_SDK_EXPORT make_face(const std::shared_ptr<image> &img,
268  int32_t x, int32_t y, int32_t width, int32_t height,
269  float confidence,
270  const std::vector< std::tuple<int32_t, int32_t> > &landmarks,
271  const std::shared_ptr<image> &cropped_image,
272  uint32_t version);
273 
288  std::shared_ptr<face_sdk::face> FACE_SDK_EXPORT make_face(const std::shared_ptr<image> &img,
289  int32_t x, int32_t y, int32_t width, int32_t height,
290  float confidence,
291  const std::vector< std::tuple<int32_t, int32_t> > &landmarks,
292  const std::shared_ptr<image> &cropped_image,
293  bool out_of_bounds,
294  uint32_t version);
295 
297 }
298 
299 
300 #endif // FACE_SDK_FACE_H
std::shared_ptr< face_sdk::face > make_face(const std::shared_ptr< image > &img, int32_t x, int32_t y, int32_t width, int32_t height, float confidence, const std::vector< std::tuple< int32_t, int32_t > > &landmarks, const std::shared_ptr< image > &cropped_image, bool out_of_bounds, uint32_t version)
Makes the face object with specified coordinates of bounding box, landmarks, cropped_image, out_of_bounds flag and version.
The face object. Face object contains information about face bounding box on the image and the origin...
Definition: face.h:37
Definition: alignment_info.h:8