我用下面的代码从图像中检测脸:人脸检测算法是不工作
-(void)markFaces:(UIImageView *)imagePick {
CIImage* image = [CIImage imageWithCGImage:imagePick.image.CGImage];
CIDetector* detector = [CIDetector detectorOfType:CIDetectorTypeFace
context:nil options:[NSDictionary dictionaryWithObject:CIDetectorAccuracyHigh forKey:CIDetectorAccuracy]];
NSDictionary* imageOptions = [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:6] forKey:CIDetectorImageOrientation];
NSLog(@"imageOptions %@",imageOptions);
NSArray* features = [detector featuresInImage:image options:imageOptions];
if([features count] > 0)
{
NSLog(@"Face Found");
}
else
{
NSLog(@"Face not Found");
}
}
,如果我从横向单击快照这种算法是行不通的模式。为什么?任何帮助,将不胜感激。
由于提前
它用于以纵向倒置模式拍摄的图像(顶部的主页按钮)。您可以尝试通过应用转换来旋转捕捉图像。 – lukya 2012-07-23 07:16:24
看一下它 http://stackoverflow.com/questions/10496724/how-to-develop-a-face-recognition-iphone-app/10497002#10497002 它可以帮助你:) – 2012-07-23 07:18:28