public class Facemark extends Algorithm
// Using Facemark in your code:
Ptr<Facemark> facemark = createFacemarkLBF();
The typical pipeline for facemark detection is as follows:
Modifier | Constructor and Description |
---|---|
protected |
Facemark(long addr) |
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.
|
clear, empty, getDefaultName, getNativeObjAddr, save
public static Facemark __fromPtr__(long addr)
public boolean fit(Mat image, MatOfRect faces, List<MatOfPoint2f> landmarks)
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);
public void loadModel(String model)
model
- A string represent the filename of a trained model.
<B>Example of usage</B>
facemark->loadModel("../data/lbf.model");
Generated on Wed Oct 9 2019 23:24:43 UTC / OpenCV 4.1.2