Created
March 5, 2019 02:05
-
-
Save treyhuffine/8b3d8aa8d36b09a6cc03e4ddd0b16ea0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vector<Rect> faces; | |
faceDetector(img, faces, face_cascade); | |
// Check if faces detected or not | |
if (faces.size() != 0) { | |
// We assume a single face so we look at the first only | |
cv::rectangle(img, faces[0], Scalar(255, 0, 0), 2); | |
vector<vector<Point2f> > shapes; | |
if (facemark->fit(img, faces, shapes)) { | |
// Draw the detected landmarks | |
drawFacemarks(img, shapes[0], cv::Scalar(0, 0, 255)); | |
} | |
} else { | |
cout << "Faces not detected." << endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment