Antal.Ai - Virtual Makeup
Public Member Functions | List of all members
visualization::FaceDrawer Class Reference

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 &currentFace, const std::vector< cv::Point > &currentFaceLandmark)
 

Detailed Description

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.

Member Function Documentation

◆ draw()

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.

Parameters
facialPointsVector of facial points.
imageOpenCV Mat image on which triangles are to be drawn.

◆ loadTriangles() [1/2]

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.

Parameters
pathFile path to load triangles from.
Exceptions
std::runtime_errorif the file cannot be read or is incorrect.

◆ loadTriangles() [2/2]

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.

Parameters
pathMemory buffer to load triangles from.
Exceptions
std::runtime_errorif the memory buffer empty or incorrect.

The documentation for this class was generated from the following files: