CGAffineTransform transform = CGAffineTransformMakeScale(1, -1);
transform = CGAffineTransformTranslate(transform,
0,-facePicture.bounds.size.height);
for (CIFaceFeature *faceFeature in features) {
// Transform CoreImage coordinates to UIKit
CGRect faceRect = CGRectApplyAffineTransform(faceFeature.bounds, transform);
if (faceFeature.hasMouthPosition) {
// Transform CoreImage coordinates to UIKit
CGPoint mouthPos = CGPointApplyAffineTransform(faceFeature.mouthPosition, transform);
}
}
the only thing I see wrong on your code is this:
[mustacheview setFrame:CGRectMake(mouthPos.x, mouthPos.y, mustacheview.frame.size.width, mustacheview.frame.size.height)];
you should use:
[mustacheview setCenter:mouthPos];
because the detector returns the mouth center point.