Loading...
Searching...
No Matches
cv::face::Facemark Class Referenceabstract
Abstract base class for all facemark models. More...
#include <opencv2/face/facemark.hpp>
Inheritance diagram for cv::face::Facemark:

Public Member Functions | |
virtual bool | fit (InputArray image, InputArray faces, OutputArrayOfArrays landmarks)=0 |
Detect facial landmarks from an image. | |
virtual void | loadModel (String model)=0 |
A function to load the trained model before the fitting process. | |
![]() | |
Algorithm () | |
virtual | ~Algorithm () |
virtual void | clear () |
Clears the algorithm state. | |
virtual bool | empty () const |
Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read. | |
virtual String | getDefaultName () const |
virtual void | read (const FileNode &fn) |
Reads algorithm parameters from a file storage. | |
virtual void | save (const String &filename) const |
void | write (const Ptr< FileStorage > &fs, const String &name=String()) const |
virtual void | write (FileStorage &fs) const |
Stores algorithm parameters in a file storage. | |
void | write (FileStorage &fs, const String &name) const |
Additional Inherited Members | |
![]() | |
template<typename _Tp > | |
static Ptr< _Tp > | load (const String &filename, const String &objname=String()) |
Loads algorithm from the file. | |
template<typename _Tp > | |
static Ptr< _Tp > | loadFromString (const String &strModel, const String &objname=String()) |
Loads algorithm from a String. | |
template<typename _Tp > | |
static Ptr< _Tp > | read (const FileNode &fn) |
Reads algorithm from the file node. | |
![]() | |
void | writeFormat (FileStorage &fs) const |
Detailed Description
Abstract base class for all facemark models.
To utilize this API in your program, please take a look at the Tutorial on Facial Landmark Detector API
Description
Facemark is a base class which provides universal access to any specific facemark algorithm. Therefore, the users should declare a desired algorithm before they can use it in their application.
Here is an example on how to declare a facemark algorithm:
// Using Facemark in your code:
Ptr<Facemark> facemark = createFacemarkLBF();
The typical pipeline for facemark detection is as follows:
- Load the trained model using Facemark::loadModel.
- Perform the fitting on an image via Facemark::fit.
Member Function Documentation
◆ fit()
|
pure virtual |
Detect facial landmarks from an image.
- Parameters
-
image Input image. faces Output of the function which represent region of interest of the detected faces. Each face is stored in cv::Rect container. landmarks The detected landmark points for each faces.
Example of usage
std::vector<Rect> faces;
std::vector<std::vector<Point2f> > landmarks;
facemark->fit(image, faces, landmarks);
CV_EXPORTS_W Mat imread(const String &filename, int flags=IMREAD_COLOR)
Loads an image from a file.
◆ loadModel()
|
pure virtual |
A function to load the trained model before the fitting process.
- Parameters
-
model A string represent the filename of a trained model.
Example of usage
facemark->loadModel("../data/lbf.model");
The documentation for this class was generated from the following file:
- opencv2/face/facemark.hpp