org.opencv.face

## Class Facemark

- java.lang.Object
- - org.opencv.core.Algorithm
  - - org.opencv.face.Facemark

- Direct Known Subclasses:
    FacemarkKazemi, FacemarkTrain

      public class Facemark
      extends Algorithm

  Abstract base class for all facemark models To utilize this API in your program, please take a look at the REF: tutorial_table_of_content_facemark ### 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.

- - ### Field Summary

    - ### Fields inherited from class org.opencv.core.Algorithm

      `nativeObj`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `Facemark(long addr)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Facemark` | `__fromPtr__(long addr)`
    `protected void` | `finalize()`
    `boolean` | `fit(Mat image, MatOfRect faces, List<MatOfPoint2f> landmarks)` Detect facial landmarks from an image.
    `void` | `loadModel(String model)` A function to load the trained model before the fitting process.

    - ### Methods inherited from class org.opencv.core.Algorithm

      `clear, empty, getDefaultName, getNativeObjAddr, save`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Facemark

          protected Facemark(long addr)

  - ### Method Detail

    - #### __fromPtr__

          public static Facemark __fromPtr__(long addr)

    - #### fit

          public boolean fit(Mat image,
                             MatOfRect faces,
                             List<MatOfPoint2f> landmarks)

      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. <B>Example of usage</B> `Mat image = imread("image.jpg"); std::vector<Rect> faces; std::vector<std::vector<Point2f> > landmarks; facemark->fit(image, faces, landmarks);`
      Returns:
        automatically generated

    - #### loadModel

          public void loadModel(String model)

      A function to load the trained model before the fitting process.
      Parameters:
        `model` - A string represent the filename of a trained model. <B>Example of usage</B> `facemark->loadModel("../data/lbf.model");`

    - #### finalize

          protected void finalize()
                           throws Throwable

      Overrides:
        `finalize` in class `Algorithm`
      Throws:
        `Throwable`

Generated on Thu Jul 25 2019 21:39:44 UTC / OpenCV 3.4.7