【发布时间】:2015-03-29 12:25:36
【问题描述】:
我正在使用 Core Image 进行这样的人脸检测:
CIImage* image = [CIImage imageWithCGImage:aImage.CGImage];
//create Facedetector
NSDictionary *opts = [NSDictionary dictionaryWithObject:CIDetectorAccuracyHigh
forKey:CIDetectorAccuracy];
CIDetector* detector = [CIDetector detectorOfType:CIDetectorTypeFace
context:nil
options:opts];
//Pull out the features of the face and loop through them
NSArray* features = [detector featuresInImage:image];
但我发现当我使用一张完全人脸的图片时,它可以正确检测到人脸,但是当我使用一张不完全人脸时,它就失败了,就像下面的截图:
我的代码有什么问题,是不是 CIDetector 只适用于完整的脸?
[更新] here是我的代码,我只能检测到左边
【问题讨论】:
-
使用 featuresInImage:options: 而不是 featuresInImage: 与此处建议的方向信息developer.apple.com/library/prerelease/ios/documentation/…
-
您的意思是使用示例图像无法检测到人脸吗?您使用该图像检测到多少张面孔?
-
@gabbler 其实图片里只有一张脸,快捷方式有两张图片:)
-
那么,您帖子中的图片包含两张脸,但只检测到一张脸?
-
@gabbler 是的,只检测到左侧图像
标签: ios objective-c face-detection core-image face-recognition