• Stars
    star
    256
  • Rank 159,219 (Top 4 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created over 6 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

iOS中国二代身份证扫描识别,目前支持识别姓名和身份证号。

SSIDCard

Version License Platform 图片

介绍

扫描识别姓名身份证号,完美支持bitcode,姓名和身份证号都是自己训练的模型,因为中文字符庞大,只训练了简单的常用字符,所以姓名识别并不是很准确。

demo报错

执行pod install 后运行dmeo报错,请增加下图红框中信息

使用

  • Podfilepod 'SSIDCard'
  • info.plist文件中增加Privacy - Camera Usage Description描述
  • 导入头文件<SSIDCard/SSIDCard.h>
  • 两种调用方式:
    • block:
     OC:
     SSScanViewController *scanVC = [[SSScanViewController alloc] initWithBlock:^(SSIDCard *idcard) {
     	self.nameLbale.text = [NSString stringWithFormat:@"姓名:%@", idcard.idName];
     	self.numberLabel.text = [NSString stringWithFormat:@"身份证号:%@", idcard.idNumber];
     }];
     [self presentViewController:scanVC animated:YES completion:nil];
    
     Swift:
     let vc = SSScanViewController.init { (idcard) in
     		print(idcard.idName ?? "")
     	}
     self.present(vc!, animated: true, completion: nil)
    
    • delegate
     SSScanViewController *scanVC = [[SSScanViewController alloc] init];
     scanVC.delegate = self;
     实现代理方法:- (void)ss_scanViewController:(SSScanViewController *)scanViewController didObtainedRecognizeResult:(SSIDCard *)idcard
    

License

SSIDCard is available under the MIT license. See the LICENSE file for more info.