使用CoreImage进行人脸识别

CSDN学院讲师招募,诚邀您加入!博客Markdown编辑器上线啦那些年我们追过的Wrox精品红皮计算机图书PMBOK第五版精讲视频教程火星人敏捷开发1001问

使用CoreImage进行人脸识别

分类:IOS开发

代码

– (BOOL)checkImageHasFace{BOOL hasFace = NO;CIImage *begingImage = [[CIImage alloc] initWithImage:_postImage];//创建CIDetector对象,,options使用NSDictionary设置采用高品质还是低品质,这里使用低品质。CIDetector *detector = [CIDetector detectorOfType:CIDetectorTypeFace context:nil options:[NSDictionary dictionaryWithObject:CIDetectorAccuracyLow forKey:CIDetectorAccuracy]];//返回数组中包含图片脸部特征信息NSArray *faceFeatures = [detector featuresInImage:begingImage];for (CIFaceFeature *faceFeature in faceFeatures) {//左眼位置、右眼位置和嘴的位置if (faceFeature.hasLeftEyePosition&&faceFeature.hasRightEyePosition&&faceFeature.hasMouthPosition) {hasFace = YES;}}return hasFace;}

上一篇iOS8使用UIVisualEffectView实现模糊效果下一篇CATransition自定义UIViewController过渡动画

顶1踩0

主题推荐猜你在找

查看评论

* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场

核心技术类目

而有的旅行是释放负面情绪,换个心情,轻装上阵。

使用CoreImage进行人脸识别

相关文章:

你感兴趣的文章:

标签云: