【发布时间】:2015-08-19 14:00:40
【问题描述】:
是否有人知道如何使用 CIdetector 在 IOS 8 和 IOS 7 中检测人脸检测。我在检测面部时遇到问题。 我已经在 iPhone 6 plus、iPhone 5s 和 iPhone 4s 设备上进行了测试。
http://maniacdev.com/2011/11/tutorial-easy-face-detection-with-core-image-in-ios-5/
以上所有链接代码都经过测试,但结果相同..请帮助我
` CIImage* image = [CIImage imageWithCGImage:facePicture.image.CGImage]; CIContext *context = [CIContext contextWithOptions:nil]; // 1 NSDictionary *opts = @{ CIDetectorAccuracy : CIDetectorAccuracyHigh }; // 2 CIDetector *detector = [CIDetectordetectorOfType:CIDetectorTypeFace 上下文:上下文 选项:选择]; // 3
if([[image properties] valueForKey:(NSString *)kCGImagePropertyOrientation] == nil)
{
opts = @{CIDetectorImageOrientation : [NSNumber numberWithInt:1]};
}
else
{
opts = @{CIDetectorImageOrientation : [[image properties] valueForKey:(NSString *)kCGImagePropertyOrientation]};
}
NSArray *features = [检测器 featuresInImage:image options:opts];`
提前致谢
【问题讨论】:
-
stackoverflow.com/questions/19055760/… ------ 也用这个
-
能否贴一些代码,让我们尝试重现?