![]() |
Spoofing Detection Engine
1.0
|
Main engine class for processing images and applying visual features. More...
#include <EngineBase.h>


Public Member Functions | |
| EngineBase () | |
| Default constructor for the EngineBase class. | |
| virtual | ~EngineBase () |
| Destructor for the EngineBase class. | |
| virtual void | init (std::string resourcePath) |
| Initializes the engine with the specified resource path. More... | |
| virtual void | process (cv::Mat &input, cv::Mat &output)=0 |
| Processes an input image and produces an output image. More... | |
| void | addSigno (cv::Mat &image) |
| Adds a watermark (signo) to the specified image. More... | |
| 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. More... | |
Protected Member Functions | |
| cv::Mat | preProcessImage (cv::Mat &image) |
| Prepare the input image for further processing. More... | |
| cv::Mat | postProcessImage (cv::Mat &image, cv::Mat &workingFrame) |
| Remove padding and convert the processed image back to the original format. More... | |
Protected Attributes | |
| std::string | faceVerticesPath |
| Path to the face vertices data file in the virtual file system. | |
| core::face::FaceDetectorYunet | detector |
| Face detector object used for detecting faces within images. | |
| visualization::FaceDrawer | faceDrawer |
| Face drawer object used for drawing face landmarks and features. | |
| core::face::FaceMesh | faceMesh |
| Face mesh object used for managing facial geometry data. | |
| core::filter::LandmarkFlowFilter | filter |
| cv::Rect | imageRect |
| float | padding_ratio = 0.3 |
| int | top = 0 |
| int | bottom = 0 |
| int | left = 0 |
| int | right = 0 |
| std::map< int, std::deque< std::map< std::string, double > > > | mHistory |
Static Protected Attributes | |
| static constexpr size_t | HISTORY_LENGTH = 50 |
Main engine class for processing images and applying visual features.
The EngineBase class handles initialization, image processing, and adding a watermark (signo) to images. It utilizes resources for face detection, face mesh, and visual enhancements, such as makeup templates.
| void EngineBase::addSigno | ( | cv::Mat & | image | ) |
Adds a watermark (signo) to the specified image.
This method places a copyright text on the bottom right corner of the image.
| image | Reference to the image (cv::Mat) where the watermark is added. |

| void EngineBase::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.
| frame | Image onto which the chart should be drawn. |
| haloRect | Reference face rectangle used for positioning the chart. |
| history | Deque containing maps of label->value pairs. |
| colors | Color mapping for the different labels. |

|
virtual |
Initializes the engine with the specified resource path.
| resourcePath | Path to the resources needed for initialization. |
Reimplemented in SpoofEngine.


|
protected |
Remove padding and convert the processed image back to the original format.
| image | Original input image. |
| workingFrame | Processed frame with padding. |


|
protected |
Prepare the input image for further processing.
Converts color formats when needed and applies padding around the original image.
| image | Input image to preprocess. |

|
pure virtual |
Processes an input image and produces an output image.
This method applies various transformations or effects to the input image using face detection and enhancement tools.
| input | Reference to the input image (cv::Mat) to be processed. |
| output | Reference to the output image (cv::Mat) where the result is stored. |
Implemented in SpoofEngine.