【发布时间】:2014-04-29 22:55:21
【问题描述】:
@ 清单 2-1 创建人脸检测器
CIContext *context = [CIContext contextWithOptions:nil]; // 1
NSDictionary *opts = @{ CIDetectorAccuracy : CIDetectorAccuracyHigh }; // 2
CIDetector *detector = [CIDetector detectorOfType:CIDetectorTypeFace
context:context
options:opts]; // 3
opts = @{ CIDetectorImageOrientation :
[[myImage properties] valueForKey:kCGImagePropertyOrientation] }; // 4
NSArray *features = [detector featuresInImage:myImage options:opts]; // 5
4.设置一个选项字典来查找面孔。让 Core Image 知道图像方向很重要,这样检测器就知道在哪里可以找到直立的脸。大多数情况下,您会从图像本身读取图像方向,然后将该值提供给选项字典。
Use of undeclared identifier 'kCGImagePropertyOrientation'
这个图像道具的方向应该是什么?
什么样的对象?
我该如何设置?
【问题讨论】:
-
提问时刻薄无济于事
-
你导入CGImageProperties.h了吗?
标签: ios objective-c face-detection ciimage