Latest 0.1.6
Homepage https://github.com/appintheair/passport-ocr-ios
License MIT
Platforms ios 8.0
Dependencies TesseractOCRiOS, UIImage-Resize, GPUImage
Frameworks UIKit
Authors

DocumentsOCR

CI Status
Version
License
Platform

Screenshots

CameraOverlayView

Requirements

  • XCode 8 +
  • iOS 8.0 +

Example

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

Used frameworks

DocumentOCR framework uses

Installation

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

pod "DocumentsOCR"

Usage

Implement DocumentScannerDelegate protocol

Create your custom class, which implemets DocumentScannerDelegate protocol

    class ExampleViewController: UIViewController, DocumentScannerDelegate {

        func willBeginScanImage(image: UIImage) {
            // do something with image
        }

        func didFinishScanWithInfo(info: DocumentInfo) {
            // do something with DocumentInfo instance
        }   

        func didFailedWithError(error: NSError) {
            // handle error
        }

        // some other code here ...
    }

Create DocumentScanner instance

Initialize DocumentScanner instance with references to UIViewController and DocumentScannerDelegate

    var scanner = DocumentScanner(containerVC: self, withDelegate: self)

Present camera controller

Scanner instance can present view controller with camera and border (actually, container view controller will do this inside document scanner instance).

    func someMethod() {
        scanner.presentCameraViewController()
    }

Events after "take shoot" button pressed

After take shoot button pressed, these delegate methods called:

    func willBeginScanImage(image: UIImage)

Then if image was recognized successfull:

   func didFinishScanWithInfo(withInfo info: PassportInfo)

If some error happened

    func didFailedWithError(error: NSError)

Author

Michael Babaev, [email protected]

License

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

Issues:

Before using DocumentOCR, you must set Enable bitcode value to "No" in tesseract framework (target TesseractOCRiOS -> Build settings -> Enable Bitcode)

TODO

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

Latest podspec

{
    "name": "PassportOCR",
    "version": "0.1.6",
    "summary": "A Swift framework for machine readable documents recognition",
    "homepage": "https://github.com/appintheair/passport-ocr-ios",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Michael": "[email protected]"
    },
    "source": {
        "git": "https://github.com/appintheair/passport-ocr-ios.git",
        "tag": "0.1.6"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "PassportOCR/Classes/**/*",
    "frameworks": "UIKit",
    "dependencies": {
        "TesseractOCRiOS": [],
        "UIImage-Resize": [],
        "GPUImage": []
    }
}

Pin It on Pinterest

Share This