![]() |
Makeup Engine
1.0
|
The Makeup Engine is a software library designed to apply virtual makeup and other visual enhancements to faces detected in an image or video stream. The engine utilizes advanced face detection and landmark tracking to accurately map facial features, allowing for the realistic application of digital cosmetics. It is built upon a modular base that handles the core computer vision tasks, enabling easy extension with different visual effects.
MakeupEngine extends.core::face::FaceDetectorYunet: This class performs the initial step of robustly detecting faces in the input image using a DNN-based model from OpenCV.
core::face::FaceMesh: After a face is located, this class generates a detailed mesh of facial landmarks. These landmarks are crucial as they define the exact regions where makeup should be applied, such as the lips, eyes, and cheeks.
visualization::FaceDrawer: This utility class is central to the makeup application. Its drawMakeupMask method uses the detected facial landmarks to overlay makeup textures and colors onto the face. It processes a reference face with makeup and transfers the look to the current face by warping the makeup mask according to the user's specific facial geometry.
core::filter::LandmarkFlowFilter: In video applications, this filter tracks facial landmarks smoothly across consecutive frames. This ensures that the applied makeup remains stable and does not jitter during head movements, leading to a more realistic effect.
MakeupEngine::init(resourcePath) initializes the engine, loading all necessary resources such as face detection models and makeup templates.MakeupEngine::process(input, output) executes the full pipeline on an input image: it detects faces, generates landmarks, applies the virtual makeup, and writes the result to the output image.FaceDrawer::drawMakeupMask(...) is the core function that applies the makeup. It uses the landmarks of both a reference and the current face to accurately warp and blend the makeup effect.FaceDetectorYunet::process(frame) returns a list of all faces found in the current frame.FaceMesh::process(frame, detections) enriches the detected face data with a detailed set of landmark points.The project files are organized in the C:/Projects/Engine/AntalEngine/Engine directory. Key header files include: