我用下面的代碼從圖像中檢測臉:人臉檢測算法是不工作
-(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