iOS 脸部识别:CLFaceDetectionImagePicker
jopen
10年前
CLFaceDetectionImagePicker 是脸部识别 ImagePicker,支持 iPad,iOS 7/8,非常容易使用和自定义,完全使用 Objective-C 编写,没有 OPENCV。
Demo Usage
Please download all of the files in the repo and run it directly to have a look.
Use CLFaceDetectionImagePicker wisely! Lights in front of the camera will affect the accuracy of face detection.
Initialize
Using CLFaceDetectionImagePicker in your app will usually look as simple as this :
_imagePickerViewController = [CLFaceDetectionImagePickerViewController new]; _imagePickerViewController.delegate = self; //Show the ImagePicker [self presentViewController:self.imagePickerViewController animated:YES completion:nil];
Delegate
After the imagePicker take photo or dismiss without detecting any face, it will fire CLFaceDetectionImagePickerDidDismiss delegate function as below which you need to apply
//After getting data callback -(void)CLFaceDetectionImagePickerDidDismiss:(NSData *)data blnSuccess:(BOOL)blnSuccess { self.statusInfo.text = (blnSuccess)?@"Success":@"Failed"; if(data){ self.imageView.image = [UIImage imageWithData:data]; self.imageView.hidden = NO; }else{ self.imageView.hidden = YES; } }