Face++主要实现人脸的扫描,定位五官位置。判断微笑程度,年龄等。
实现人脸识别等。
下载地址:http://www.faceplusplus.com.cn
以下是对此类库的使用笔记
//
// RootViewController.m
// FacePlusPlusDemo_and_SDK
//
// Created by lihao on 14-3-26.
// Copyright (c) 2014年 lihao All rights reserved.
//
#import "RootViewController.h"
#import "APIKey+APISecret.h"
#import "FaceppAPI.h"
@interface RootViewController ()
{
UIImage * _image;
UIImage * _image2;
}
@property(nonatomic,retain)UIImageView * imageView;
@end
@implementation RootViewController
-(void)dealloc{
[self.imageView release];
[super dealloc];
}
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
_image = [UIImage imageNamed:@"face.jpg"];
_image2 = [UIImage imageNamed:@"5E151821891.jpg"];
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
//添加到UIImageView上,方便框出脸部等
self.imageView = [[UIImageView alloc]initWithFrame:CGRectMake(10, 0, 150, _image.size.height/(_image.size.width/150))];
[_imageView setImage:_image];
[self.view addSubview:_imageView];
[_imageView release];
UIButton * firstButton = [UIButton buttonWithType:UIButtonTypeSystem];
[firstButton setFrame:CGRectMake(10, 200, 150, 30)];
[firstButton setBackgroundColor:[UIColor yellowColor]];
[firstButton setTitle:@"/detection/detect" forState:UIControlStateNormal];
[firstButton addTarget:self action:@selector(firstButtonClick:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:firstButton];
UIButton * secondButton = [UIButton buttonWithType:UIButtonTypeSystem];
[secondButton setFrame:CGRectMake(10, 250, 150, 30)];
[secondButton setBackgroundColor:[UIColor yellowColor]];
[secondButton setTitle:@"/detection/landmark" forState:UIControlStateNormal];
[secondButton addTarget:self action:@selector(secondButtonClick:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:secondButton];
UIButton * thirdButton = [UIButton buttonWithType:UIButtonTypeSystem];
[thirdButton setFrame:CGRectMake(10, 300, 150, 30)];
[thirdButton setBackgroundColor:[UIColor yellowColor]];
[thirdButton setTitle:@"/group/create/delete" forState:UIControlStateNormal];
[thirdButton addTarget:self action:@selector(thirdButtonClick:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:thirdButton];
UIButton * forthButton = [UIButton buttonWithType:UIButtonTypeSystem];
[forthButton setFrame:CGRectMake(10, 350, 150, 30)];
[forthButton setBackgroundColor:[UIColor yellowColor]];
[forthButton setTitle:@"/person/create/delete" forState:UIControlStateNormal];
[forthButton addTarget:self action:@selector(forthButtonClick:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:forthButton];
UIButton * fifthButton = [UIButton buttonWithType:UIButtonTypeSystem];
[fifthButton setFrame:CGRectMake(10, 400, 150, 30)];
[fifthButton setBackgroundColor:[UIColor yellowColor]];
[fifthButton setTitle:@"/per/add/rem/face" forState:UIControlStateNormal];
[fifthButton addTarget:self action:@selector(fifthButtonClick:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:fifthButton];
UIButton * sixButton = [UIButton buttonWithType:UIButtonTypeSystem];
[sixButton setFrame:CGRectMake(10, 450, 150, 30)];
[sixButton setBackgroundColor:[UIColor yellowColor]];
[sixButton setTitle:@"/person/get_info" forState:UIControlStateNormal];
[sixButton addTarget:self action:@selector(sixButtonClick:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:sixButton];
UIButton * sevenButton = [UIButton buttonWithType:UIButtonTypeSystem];
[sevenButton setFrame:CGRectMake(10, 500, 150, 30)];
[sevenButton setBackgroundColor:[UIColor yellowColor]];
[sevenButton setTitle:@"/person/set_info" forState:UIControlStateNormal];
[sevenButton addTarget:self action:@selector(sevenButtonClick:) forControlEvents:UIControlEventTouchUpInside];