| 
    OpenCV453
    
   | 
 
Abstract base class for trainable facemark models [詳解]
#include <facemark_train.hpp>
cv::face::Facemarkを継承しています。
cv::face::FacemarkAAM, cv::face::FacemarkLBFに継承されています。
公開メンバ関数 | |
| virtual bool | addTrainingSample (InputArray image, InputArray landmarks)=0 | 
| Add one training sample to the trainer.  [詳解] | |
| virtual void | training (void *parameters=0)=0 | 
| Trains a Facemark algorithm using the given dataset. Before the training process, training samples should be added to the trainer using face::addTrainingSample function.  [詳解] | |
| virtual bool | setFaceDetector (FN_FaceDetector detector, void *userData=0)=0 | 
| Set a user defined face detector for the Facemark algorithm.  [詳解] | |
| virtual bool | getFaces (InputArray image, OutputArray faces)=0 | 
| Detect faces from a given image using default or user defined face detector. Some Algorithm might not provide a default face detector.  [詳解] | |
| virtual bool | getData (void *items=0)=0 | 
| Get data from an algorithm  [詳解] | |
  基底クラス cv::face::Facemark に属する継承公開メンバ関数 | |
| virtual CV_WRAP void | loadModel (String model)=0 | 
| A function to load the trained model before the fitting process.  [詳解] | |
| virtual CV_WRAP bool | fit (InputArray image, InputArray faces, OutputArrayOfArrays landmarks)=0 | 
| Detect facial landmarks from an image.  [詳解] | |
  基底クラス cv::Algorithm に属する継承公開メンバ関数 | |
| virtual CV_WRAP void | clear () | 
| Clears the algorithm state  [詳解] | |
| virtual void | write (FileStorage &fs) const | 
| Stores algorithm parameters in a file storage  [詳解] | |
| CV_WRAP void | write (const Ptr< FileStorage > &fs, const String &name=String()) const | 
| simplified API for language bindings これはオーバーロードされたメンバ関数です。利便性のために用意されています。元の関数との違いは引き数のみです。  | |
| virtual CV_WRAP void | read (const FileNode &fn) | 
| Reads algorithm parameters from a file storage  [詳解] | |
| virtual CV_WRAP bool | empty () const | 
| Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read  [詳解] | |
| virtual CV_WRAP void | save (const String &filename) const | 
| virtual CV_WRAP String | getDefaultName () const | 
その他の継承メンバ | |
  基底クラス cv::Algorithm に属する継承静的公開メンバ関数 | |
| template<typename _Tp > | |
| static Ptr< _Tp > | read (const FileNode &fn) | 
| Reads algorithm from the file node  [詳解] | |
| 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  [詳解] | |
  基底クラス cv::Algorithm に属する継承限定公開メンバ関数 | |
| void | writeFormat (FileStorage &fs) const | 
Abstract base class for trainable facemark models
To utilize this API in your program, please take a look at the tutorial_table_of_content_facemark
The AAM and LBF facemark models in OpenCV are derived from the abstract base class FacemarkTrain, which provides a unified access to those facemark algorithms in OpenCV.
Here is an example on how to declare facemark algorithm:
The typical pipeline for facemark detection is listed as follows:
      
  | 
  pure virtual | 
Add one training sample to the trainer.
| image | Input image. | 
| landmarks | The ground-truth of facial landmarks points corresponds to the image. | 
Example of usage
The contents in the training files should follows the standard format. Here are examples for the contents in these files. example of content in the images_train.txt
example of content in the points_train.txt
      
  | 
  pure virtual | 
Get data from an algorithm
| items | The obtained data, algorithm dependent. | 
Example of usage
      
  | 
  pure virtual | 
Detect faces from a given image using default or user defined face detector. Some Algorithm might not provide a default face detector.
| 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. | 
Example of usage
      
  | 
  pure virtual | 
Set a user defined face detector for the Facemark algorithm.
| detector | The user defined face detector function | 
| userData | Detector parameters | 
Example of usage
Example of a user defined face detector
TODO Lifetime of detector parameters is uncontrolled. Rework interface design to "Ptr<FaceDetector>".
      
  | 
  pure virtual | 
Trains a Facemark algorithm using the given dataset. Before the training process, training samples should be added to the trainer using face::addTrainingSample function.
| parameters | Optional extra parameters (algorithm dependent). | 
Example of usage