If your goal is to restore the position of the face and eyes in iOS, why donβt you use the capabilities of CoreImage?
CIImage *image = [CIImage imageWithContentsOfURL:[NSURL fileURLWithPath:@"image.jpg"]]; NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:CIDetectorAccuracyHigh, CIDetectorAccuracy, nil]; CIDetector *faceDetector = [CIDetector detectorOfType:CIDetectorTypeFace context:nil options:options]; NSArray *features = [faceDetector featuresInImage:image]; for(CIFaceFeature* faceFeature in features) { CGRect faceSize = faceFeature.bounds.size; PointF leftEyePosition; PointF rightEyePosition; PointF mouthPosition; if(faceFeature.hasLeftEyePosition) leftEyePosition = faceFeature.leftEyePosition;
It does not use OpenCV, but you get a free oral cavity.
source share