Face Engine SDK 5.25.0
A face detection, recognition and tracking engine.
Loading...
Searching...
No Matches
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
11namespace 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
84
91} // namespace fsdk
#define FSDK_API
Dummy.
Definition Def.h:27
SDK namespace.
Definition IAGSEstimator.h:8
Landmarks5 FSDK_API convert(const Landmarks68 &landmarks)
convert landmarks68 into landmarks5
Vector2< float > Landmark
Landmark floating point coordinates type.
Definition Landmarks.h:13
Enumerates detected landmarks. Only valid for template with 5 landmarks.
Definition Landmarks.h:74
@ LandmarkNose
Nose tip. Same as FL_NOSE_TIP.
Definition Landmarks.h:78
@ LandmarkMouthRightCorner
Mouth right corner. Same as FL_MOUTH_RIGHT_CORENR.
Definition Landmarks.h:80
@ LandmarkMouthLeftCorner
Mouth left corner. Same as FL_MOUTH_LEFT_CORNER.
Definition Landmarks.h:79
@ LandmarkRightEye
Right eye center.
Definition Landmarks.h:77
@ LandmarkLeftEye
Left eye center.
Definition Landmarks.h:76
@ LandmarkCount
Not a landmark; counts number of detected landmarks.
Definition Landmarks.h:81
Face landmarks template structure.
Definition Landmarks.h:23
Landmark landmarks[numOfLandmarks]
Detected landmarks.
Definition Landmarks.h:29
Generic 2D vector.
Definition Vector2.h:10