/passport-ocr-ios

Primary LanguageSwiftMIT LicenseMIT

DocumentsOCR

CI Status Version License Platform

Screenshots

CameraOverlayView

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

This framework uses TesseractOCRiOS for text recognition of machine readable codes. To use DocumentsOCR, add tessdata/eng.traineddata to your app repository.

Installation

DocumentsOCR is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "DocumentsOCR"

Usage

  1. Create scanner instance with your UIViewController instance reference, which implemets DocumentScannerDelegate protocol
    scanner = DocumentScanner(containerVC: self, withDelegate: self)
  1. Scanner instance can show view controller with camera and border
    scanner.showCameraViewController()
  1. After take shoot button pressed, these delegate methods called:
    func willBeginScan(withImage image: UIImage)

then if image was recognized successfull:

   func didFinishScan(withInfo info: PassportInfo)

if some error happened

    func didFailed(error: NSError)

Author

Michael, mmbabaev@gmail.com

License

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

TODO

  • documentation
  • small screenshots
  • fix minor UI defects in example
  • code refactoring
  • pod string for all versions (without using ~> version")
  • check visa document recognitions
  • unit tests for camera shoots
  • take many pictures when "take shoot" button pressed, then choose best image for recognition

TST