ssi

SSIDCard

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

Showing:

Popularity

Downloads/wk

0

GitHub Stars

256

Maintenance

Last Commit

3yrs ago

Contributors

1

Package

Dependencies

0

License

MIT

Categories

Readme

SSIDCard

Version License Platform 图片

介绍

扫描识别姓名身份证号,完美支持bitcode

运行示例程序

克隆方式

  • git clone https://github.com/sansansisi/SSIDCard.git
  • cd SSIDCard
  • git lfs pull (请先安装Git LFS,如果克隆下来时,/SSIDCard/Frameworks/opencv2.framework/Versions/A 路径下存在opencv文件(245M大小),就跳过这一步)
  • cd Example
  • pod install

直接下载压缩包方式

直接下载的zip解压运行,会缺少opencv文件,请去opencv 下载3.4.1版本的opencv2.framework替换掉本工程的/SSIDCard/Frameworks/opencv2.framework文件,然后执行pod install就可以正确执行示例程序。

使用

  • 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.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100