There's a lot of tutorials on how to detect face rects using OpenCV, with something like:
//Path to the training parameters for frontal face detector
NSString *faceCascadePath = [[NSBundle mainBundle] pathForResource:@"haarcascade_frontalface_alt2"
ofType:@"xml"];
NSLog(@"%@", faceCascadePath);
const CFIndex CASCADE_NAME_LEN = 2048;
char *CASCADE_NAME = (char *) malloc(CASCADE_NAME_LEN);
CFStringGetFileSystemRepresentation( (CFStringRef)faceCascadePath, CASCADE_NAME, CASCADE_NAME_LEN);
cv::CascadeClassifier faceDetector;
faceDetector.load(CASCADE_NAME);
std::vector<cv::Rect> faceRects;
double scalingFactor = 1.1;
int minNeighbors = 2;
int flags = 0;
cv::Size minimumSize(30, 30);
faceDetector.detectMultiScale(image, faceRects, scalingFactor, minNeighbors, flags, minimumSize);
However this, like its CoreImage equivalent, only detects the bounds of the face as a rectangle. What I want is to detect the face edges in points so that I can draw a path around a user's face, similar to how Snapchat does it.
Can anyone point me in the right direction? Computer vision and image processing aren't my forte so I've been struggling to even get started on accomplishing something like this.