5 #include <opencv2/imgcodecs.hpp>
8 #include "FaceDetectorYunet.h"
16 #include <emscripten/emscripten.h>
17 #include <emscripten/val.h>
22 void log(
const std::string& message) {
23 emscripten::val console = emscripten::val::global(
"console");
24 console.call<
void>(
"log", message);
30 void log(
const std::string& message) {
32 std::cout << message << std::endl;
63 virtual void init(std::string resourcePath);
74 virtual void process(cv::Mat& input, cv::Mat& output) = 0;
94 const std::deque<std::map<std::string, double>>& history,
95 const std::map<std::string, cv::Scalar>& colors);
144 float padding_ratio = 0.3;
150 static constexpr
size_t HISTORY_LENGTH = 50;
151 std::map<int, std::deque<std::map<std::string, double>>> mHistory;
Core utilities for image and math operations using OpenCV.
Header file for FaceDrawer class.
Defines the LandmarkFlowFilter class for tracking points in video frames.
Main engine class for processing images and applying visual features.
Definition: EngineBase.h:47
void addSigno(cv::Mat &image)
Adds a watermark (signo) to the specified image.
Definition: EngineBase.cpp:46
core::face::FaceDetectorYunet detector
Face detector object used for detecting faces within images.
Definition: EngineBase.h:128
EngineBase()
Default constructor for the EngineBase class.
Definition: EngineBase.h:52
virtual void init(std::string resourcePath)
Initializes the engine with the specified resource path.
Definition: EngineBase.cpp:109
core::face::FaceMesh faceMesh
Face mesh object used for managing facial geometry data.
Definition: EngineBase.h:138
cv::Mat postProcessImage(cv::Mat &image, cv::Mat &workingFrame)
Remove padding and convert the processed image back to the original format.
Definition: EngineBase.cpp:28
cv::Mat preProcessImage(cv::Mat &image)
Prepare the input image for further processing.
Definition: EngineBase.cpp:5
std::string faceVerticesPath
Path to the face vertices data file in the virtual file system.
Definition: EngineBase.h:123
void drawHistoryChart(cv::Mat &frame, const cv::Rect &haloRect, const std::deque< std::map< std::string, double >> &history, const std::map< std::string, cv::Scalar > &colors)
Draw a simple line chart visualizing the value history for a detection.
Definition: EngineBase.cpp:73
virtual ~EngineBase()
Destructor for the EngineBase class.
Definition: EngineBase.h:57
visualization::FaceDrawer faceDrawer
Face drawer object used for drawing face landmarks and features.
Definition: EngineBase.h:133
virtual void process(cv::Mat &input, cv::Mat &output)=0
Processes an input image and produces an output image.
Face detection class utilizing OpenCV's FaceDetectorYN model with DNN support.
Definition: FaceDetectorYunet.h:18
A class responsible for initializing, configuring, and processing face mesh detection using neural ne...
Definition: FaceMesh.h:16
Implements a filter to track landmarks in a sequence of images.
Definition: LandmarkFlowFilter.h:24
Draws triangulation on faces based on facial points.
Definition: FaceDrawer.h:41