Face Engine SDK  5.21.0
A face detection, recognition and tracking engine.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Landmarks.h
1 #pragma once
2 
3 #include <fsdk/Def.h>
4 
5 #include <fsdk/Types/Vector2.h>
6 
7 #include <algorithm>
8 #include <cstdint>
9 #include <iterator>
10 
11 namespace fsdk {
14 
22  template <size_t numOfLandmarks>
23  struct Landmarks {
24 
25  // FSDK_DEPRECATED("landmarkCount deprecated. Use size() method to get length")
26  static constexpr uint64_t landmarkCount = numOfLandmarks;
27 
29  Landmark landmarks[numOfLandmarks];
30 
31  Landmarks() = default;
32  ~Landmarks() = default;
33 
34  Landmarks(const Landmarks& cp) {
35  *this = cp;
36  }
37 
38  Landmarks(Landmarks&& mv) {
39  *this = std::move(mv);
40  }
41 
42  Landmarks& operator=(const Landmarks& cp) {
43  std::copy(std::begin(cp.landmarks), std::end(cp.landmarks), std::begin(landmarks));
44 
45  return *this;
46  }
47 
48  Landmarks& operator=(Landmarks&& mv) {
49  std::move(std::begin(mv.landmarks), std::end(mv.landmarks), std::begin(landmarks));
50 
51  return *this;
52  }
53 
54  constexpr size_t size() const noexcept {
55  return numOfLandmarks;
56  }
57 
58  bool isValid() const noexcept {
59  const bool invalid = std::all_of(std::begin(landmarks), std::end(landmarks), [](const Landmark& l) {
60  return l.x == 0.f && l.y == 0.f;
61  });
62  return !invalid;
63  }
64  };
65 
70 
75  enum {
82  };
83  };
84 
90  Landmarks5 FSDK_API convert(const Landmarks68& landmarks);
91 } // namespace fsdk
Enumerates detected landmarks. Only valid for template with 5 landmarks.
Definition: Landmarks.h:74
#define FSDK_API
Dummy.
Definition: Def.h:27
Face landmarks template structure.
Definition: Landmarks.h:23
Not a landmark; counts number of detected landmarks.
Definition: Landmarks.h:81
Common SDK definitions.
Mouth right corner. Same as FL_MOUTH_RIGHT_CORENR.
Definition: Landmarks.h:80
Left eye center.
Definition: Landmarks.h:76
Landmarks5 FSDK_API convert(const Landmarks68 &landmarks)
convert landmarks68 into landmarks5
Right eye center.
Definition: Landmarks.h:77
Landmarks< 68 > Landmarks68
alias for structure with 68 landmarks
Definition: Landmarks.h:69
Landmark landmarks[numOfLandmarks]
Detected landmarks.
Definition: Landmarks.h:29
Landmarks< 5 > Landmarks5
alias for structure with 5 landmarks
Definition: Landmarks.h:67
Nose tip. Same as FL_NOSE_TIP.
Definition: Landmarks.h:78
Mouth left corner. Same as FL_MOUTH_LEFT_CORNER.
Definition: Landmarks.h:79
Vector2< float > Landmark
Landmark floating point coordinates type.
Definition: Landmarks.h:13