- (void)viewDidLoad
{
[super viewDidLoad];
UIImage *image = [UIImage imageNamed:@""];
_i取得识别结果
NSArray *detectResult = [faceDetector featuresInImage:image];
UIView *resultView = [[UIView alloc] initWithFrame:];
[ addSubview:resultView];
for(CIFaceFeature* faceFeature in detectResult) {
//脸部
UIView* faceView = [[UIView alloc] initWithFrame:];
= 1;
= [UIColor orangeColor].CGColor;
[resultView addSubview:faceView];
[faceView release];
//左眼
if () {
UIView* leftEyeView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 5, 5)];
[leftEyeView setCenter:];
= 1;
= [UIColor redColor].CGColor;
[resultView addSubview:leftEyeView];
[leftEyeView release];
}
//右眼
if () {
UIView* rightEyeView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 5, 5)];
[rightEyeView setCenter:];
=
ios人脸识别 来自淘豆网m.daumloan.com转载请标明出处.