人脸识别 iOS开发
来源:互联网 发布:什么理财软件安全可靠 编辑:程序博客网 时间:2024/06/09 19:34
@property (strong,nonatomic)UIImage *ima;
@property (strong,nonatomic)UIImageView *iamgeView;
self.ima= [UIImageimageNamed:@"123.png"];
self.iamgeView = [[UIImageViewalloc]initWithImage:self.ima];
self.iamgeView.frame =CGRectMake(0,0, self.ima.size.width, self.ima.size.height);
[self.viewaddSubview:self.iamgeView];
CIImage *image = [CIImageimageWithCGImage:self.ima.CGImage];
NSDictionary *opts = [NSDictionarydictionaryWithObject:CIDetectorAccuracyHighforKey:CIDetectorAccuracy];
CIDetector* detector = [CIDetectordetectorOfType:CIDetectorTypeFacecontext:niloptions:opts];
//得到面部数据
NSArray* features = [detector featuresInImage:image];
for (CIFaceFeature *fin features)
{
CGRect aRect = f.bounds;
NSLog(@"%f, %f, %f, %f", aRect.origin.x, aRect.origin.y, aRect.size.width, aRect.size.height);
//眼睛和嘴的位置
if(f.hasLeftEyePosition) {
NSLog(@"Left eye %g %g\n", f.leftEyePosition.x, f.leftEyePosition.y);
//添加一个标记
UILabel *label = [[UILabelalloc]initWithFrame:CGRectMake(f.leftEyePosition.x,self.ima.size.height-f.leftEyePosition.y,5,5)];
label.text = @"眼";
label.textColor = [UIColorredColor];
[self.iamgeViewaddSubview:label];
}
if(f.hasRightEyePosition) {
NSLog(@"Right eye %g %g\n", f.rightEyePosition.x, f.rightEyePosition.y);
//添加一个标记
UILabel *label = [[UILabelalloc]initWithFrame:CGRectMake(f.rightEyePosition.x,self.ima.size.height-f.rightEyePosition.y,5,5)];
label.text = @"眼";
label.textColor = [UIColorredColor];
[self.iamgeViewaddSubview:label];
}
if(f.hasMouthPosition)
{
NSLog(@"Mouth %g %g\n", f.mouthPosition.x, f.mouthPosition.y);
//添加一个标记
UILabel *label = [[UILabelalloc]initWithFrame:CGRectMake(f.mouthPosition.x,self.ima.size.height-f.mouthPosition.y,5,5)];
label.text = @"嘴";
label.textColor = [UIColorredColor];
[self.iamgeViewaddSubview:label];
}
if (f.hasSmile) {
NSLog(@"笑了");
}
if (f.hasFaceAngle) {
NSLog(@"FaceAngle %f ", f.faceAngle );
}
}
- 人脸识别 iOS开发
- iOS开发技术之人脸识别
- ios人脸识别
- ios人脸识别
- iOS 人脸识别
- IOS人脸识别
- ios 人脸识别
- IOS人脸识别开发入门教程--人脸检测篇
- iOS/Android开发人脸识别SDK列表
- iOS/Android开发人脸识别SDK列表
- iOS/Android开发人脸识别SDK列表
- IOS人脸识别和二维码识别
- 【iOS开发】---- 语音识别
- IOS 开发手势识别
- iOS开发-------手势识别
- iOS开发 - 手势识别
- iOS 开发 车牌识别
- iOS实现人脸识别
- setOnTouchListener使用记录
- Js中Prototype、__proto__、Constructor、Object、Function关系介绍
- Block全面分析
- 自动化测试之unittest
- EXTJS4.x以上的版本中没有dolayout这个方法
- 人脸识别 iOS开发
- 位运算
- 转载lr spark细节
- [代码片段] Android实用代码片段整合
- Apple Pay支付分享
- Python 字符编码判断
- linux centos 64位置mysql源码包安装
- InfoQ专栏 Git历险记(四)——索引与提交的幕后故事
- 你晓得吗?大多数企业根本没有做到 DevOps!