5 #ifndef __SFL_UTILITIES__ 6 #define __SFL_UTILITIES__ 9 #include "sequence_face_landmarks.h" 21 void render(cv::Mat& img,
const std::vector<cv::Point>& landmarks,
22 bool drawLabels =
false,
const cv::Scalar& color = cv::Scalar(0, 255, 0),
31 void render(cv::Mat& img,
const cv::Rect& bbox,
32 const cv::Scalar& color = cv::Scalar(0, 255, 0),
int thickness = 1);
45 void render(cv::Mat& img,
const Face& face,
bool drawIDs =
true,
46 bool drawLabels =
false,
const cv::Scalar& bbox_color = cv::Scalar(0, 0, 255),
47 const cv::Scalar& landmarks_color = cv::Scalar(0, 255, 0),
int thickness = 1,
48 double fontScale = 1.0);
61 void render(cv::Mat& img,
const Frame& frame,
bool drawIDs =
true,
62 bool drawLabels =
false,
const cv::Scalar& bbox_color = cv::Scalar(0, 0, 255),
63 const cv::Scalar& landmarks_color = cv::Scalar(0, 255, 0),
int thickness = 1,
64 double fontScale = 1.0);
66 void renderFaceID(cv::Mat& img,
const Face& face,
const cv::Scalar& color,
int thickness = 1,
67 double fontScale = 1.0);
90 std::vector<FaceStat>& stats);
94 int getMainFaceID(
const std::list<std::unique_ptr<Frame>>& sequence);
103 cv::Point2f
getFaceLeftEye(
const std::vector<cv::Point>& landmarks);
150 const cv::Size& frameSize,
bool square);
158 std::vector<cv::Point>& full_face);
162 #endif // __SFL_UTILITIES__ float getFaceApproxVertAngle(const std::vector< cv::Point > &landmarks)
Get the face's vertical angle [radians].
int frame_count
Frames appeared in.
Definition: utilities.h:77
float frame_ratio
frame_count / total_frames
Definition: utilities.h:81
void getSequenceStats(const std::list< std::unique_ptr< Frame >> &sequence, std::vector< FaceStat > &stats)
Get the face statistics of the sequence.
float getFaceApproxTiltAngle(const std::vector< cv::Point > &landmarks)
Get the face's tilt angle [radians].
float getFaceApproxHorAngle(const std::vector< cv::Point > &landmarks)
Get the face's horizontal angle [radians].
int getMainFaceID(const std::list< std::unique_ptr< Frame >> &sequence)
Get the main face in a sequence.
cv::Point2f getFaceRightEye(const std::vector< cv::Point > &landmarks)
Get the face's right eye center position (left eye in the image).
float central_ratio
avg_center_dist / (||(avg_width, avg_height)|| / 4).
Definition: utilities.h:80
cv::Rect getFaceBBoxFromLandmarks(const std::vector< cv::Point > &landmarks, const cv::Size &frameSize, bool square)
Get face bounding box from landmarks.
float avg_size
Average face's bounding box size.
Definition: utilities.h:78
float avg_center_dist
Average distance from frame center.
Definition: utilities.h:76
cv::Point2f getFaceLeftEye(const std::vector< cv::Point > &landmarks)
Get the face's left eye center position (right eye in the image).
cv::Point3f getFaceApproxEulerAngles(const std::vector< cv::Point > &landmarks)
Get the face's euler angles [radians].
void render(cv::Mat &img, const std::vector< cv::Point > &landmarks, bool drawLabels=false, const cv::Scalar &color=cv::Scalar(0, 255, 0), int thickness=1)
Render landmarks.
void createFullFace(const std::vector< cv::Point > &landmarks, std::vector< cv::Point > &full_face)
Create full face points from landmarks.
Represents a face statistics in the sequence.
Definition: utilities.h:72
Definition: face_tracker.h:10
float size_ratio
avg_size / ((avg_width + avg_height) / 4)
Definition: utilities.h:82