How create cv::face::drawFacemarks ?
Hi! How create cv::face::drawFacemarks ? Here I found an example:
std::vector<Rect> faces;
std::vector<std::vector<Point2f> > landmarks;
facemark->getFaces(img, faces);
facemark->fit(img, faces, landmarks);
for(int j=0;j<rects.size();j++){
face::drawFacemarks(frame, landmarks[j], Scalar(0,0,255));
}
But I did not understand how to make this example work? Is there a working code with an example? I tried to do so, but the compiler returns errors:
std::vector<cv::Rect> faces;
std::vector<std::vector<cv::Point2f> > landmarks;
cv::Ptr<cv::face::Facemark> facemark = cv::face::createFacemarkLBF();
//cv::Ptr<cv::face::Facemark> facemark = cv::face::createFacemarkAAM();
facemark->getFaces(img, faces);
facemark->fit(img, faces, landmarks);
for(int j=0;j<rects.size();j++){
cv::face::drawFacemarks(frame, landmarks[j], Scalar(0,0,255));
}
and the error is ?
facemark not have function getFaces() From the code it is not clear what facemark is
https://docs.opencv.org/4.1.1/db/dd8/...
(you'll have to supply your own prior face detection)
((there is only a java sample but you'll get the idea))
Please tell me what I need to put in place of the model?
I did so. How can face recognition be completed?