@ 清单 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'
这个图像道具的方向应该是什么?
什么样的对象?
我该如何设置?