MNC Identifier SDK for iOS
MNC Identifier是一个整合了人工智能的消费者身份识别和验证服务。此SDK具有以下2个主要功能
- 人脸识别器(1.1.10)(用于人脸识别)
- OCR识别器(1.1.10)(用于光学字符识别)
安装
将以下内容添加到您的Podfile中
#This is for Face Identifier
pod 'MNCIdentifier/Face', '1.1.10'
pod 'GoogleMLKit/FaceDetection', '4.0.0'
#This is for OCR Identifier
pod 'MNCIdentifier/OCR', '1.1.10'
pod 'GoogleMLKit/TextRecognition', '4.0.0'
pod 'GoogleMLKit/ObjectDetection', '4.0.0'
人脸识别器使用方法
在Objective-C中
#import <MNCFaceIdentifier/MNCFaceIdentifierClient.h>
#import <MNCFaceIdentifier/MNCFaceIdentifierDelegate.h>
@interface ViewController() <MNCFaceIdentifierDelegate>
@end
@implementation ViewController
- (void)viewDidLoad {
.......
MNCFaceIdentifierClient client = [MNCFaceIdentifierClient new];
client.delegate = self;
}
- (void)buttonTapped:(UIButton *)sender {
[client showFaceIdentifier:self];
}
- (void)faceIdentifierResult:(MNCFaceIdentifierResult *)result {
//this function return data result from Face Identifier
//this function return captured image from process face identifier with type data UIImage
}
@end
在Swift中
import MNCFaceIdentifier
class ViewController: UIViewController, MNCFaceIdentifierDelegate {
override func viewDidLoad() {
.......
let client = MNCFaceIdentifierClient()
client.delegate = self
}
@IBAction func buttonTapped(_ sender: UIButton) {
client.showFaceIdentifier(self)
}
func faceIdentifierResult(_ result: MNCFaceIdentifierResult!) {
//this function return data result from Face Identifier
//this function return captured image from process face identifier with type data UIImage
}
}
OCR用法
在Objective-C中
#import <MNCOCRIdentifier/MNCOCRIdentifierClient.h>
#import <MNCOCRIdentifier/MNCOCRIdentifierDelegate.h>
@interface ViewController() <MNCOCRIdentifierDelegate>
@end
@implementation ViewController
- (void)viewDidLoad {
.......
MNCOCRIdentifierClient *client = [MNCOCRIdentifierClient new];
client.delegate = self;
client.isFlashEnable = NO;
client.isCameraOnly = NO; //this properties for MNCOCRIdentifer with features camera only
}
- (void)buttonTapped:(UIButton *)sender {
[client showOCRIdentifier:self];
}
- (void)ocrResult:(MNCOCRIdentifierResult *)result {
//this function return data result from OCR.
//This function return KTP image Path and KTP Data
}
@end
在Swift中
import MNCOCRIdentifier
class ViewController: UIViewController, MNCOCRIdentifierDelegate {
override func viewDidLoad() {
.......
let client = MNCOCRIdentifierClient()
client.delegate = self
client.isFlashEnable = true
client.isCameraOnly = true //this properties for MNCOCRIdentifer with features camera only
}
@IBAction func buttonTapped(_ sender: UIButton) {
client.showOCRIdentifier(self)
}
func ocrResult(_ result: MNCOCRIdentifierResult?) {
//this function return data result from OCR.
//This function return KTP image Path and KTP Data
}
}