Antal.Ai - Virtual Makeup
|
Draws triangulation on faces based on facial points. More...
#include <FaceDrawer.h>
Public Member Functions | |
void | loadTriangles (const std::string path) |
Loads triangles from a file. More... | |
void | loadTriangles (const std::vector< uchar > &faceVerticesFileContent) |
Loads triangles from memory buffer. More... | |
void | draw (cv::Mat &image, const std::vector< cv::Point > &facialPoints) |
Draws triangulation on the given image using facial points. More... | |
void | drawMakeupMask (cv::Mat &referenceFace, const std::vector< cv::Point > &referenceFaceLandmark, cv::Mat ¤tFace, const std::vector< cv::Point > ¤tFaceLandmark) |
Draws triangulation on faces based on facial points.
This class is responsible for drawing triangulation on faces using facial points. It loads predefined triangles and uses OpenCV functions to draw them.
void visualization::FaceDrawer::draw | ( | cv::Mat & | image, |
const std::vector< cv::Point > & | facialPoints | ||
) |
Draws triangulation on the given image using facial points.
This function draws triangles on the provided image based on the provided facial points. It uses OpenCV functions for drawing.
facialPoints | Vector of facial points. |
image | OpenCV Mat image on which triangles are to be drawn. |
void visualization::FaceDrawer::loadTriangles | ( | const std::string | path | ) |
Loads triangles from a file.
This function loads triangles from a given file path. The file should contain triangle vertex indices.
path | File path to load triangles from. |
std::runtime_error | if the file cannot be read or is incorrect. |
void visualization::FaceDrawer::loadTriangles | ( | const std::vector< uchar > & | faceVerticesFileContent | ) |
Loads triangles from memory buffer.
This function loads triangles from a given memory buffer. The memory buffer should contain triangle vertex indices.
path | Memory buffer to load triangles from. |
std::runtime_error | if the memory buffer empty or incorrect. |