All Projects → evermeer → Passportscanner

evermeer / Passportscanner

Licence: bsd-3-clause
Scan the MRZ code of a passport and extract the firstname, lastname, passport number, nationality, date of birth, expiration date and personal numer.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Passportscanner

Sane Scan Pdf
Sane command-line scan-to-pdf script on Linux with OCR and deskew support
Stars: ✭ 58 (-86.09%)
Mutual labels:  ocr, scanner
CleanSCAN
A simple, smart and efficient document scanner for Android
Stars: ✭ 151 (-63.79%)
Mutual labels:  ocr, scanner
Scanbot Sdk Example Android
Document scanning SDK example apps for the Scanbot SDK for Android.
Stars: ✭ 67 (-83.93%)
Mutual labels:  ocr, scanner
Gimagereader
A Gtk/Qt front-end to tesseract-ocr.
Stars: ✭ 786 (+88.49%)
Mutual labels:  ocr, scanner
Firebase-HMS-ML-Kit-Scanner-Demo
Various scanner use cases using Firebase or HMS ML-Kit
Stars: ✭ 22 (-94.72%)
Mutual labels:  ocr, scanner
Paperwork
Personal document manager (Linux/Windows) -- Moved to Gnome's Gitlab
Stars: ✭ 2,392 (+473.62%)
Mutual labels:  ocr, scanner
Open Paperless
Scan, index, and archive all of your paper documents (acquired by Mayan EDMS)
Stars: ✭ 2,538 (+508.63%)
Mutual labels:  ocr, scanner
ID-Card-Passport-Recognition-SDK-Android
On-Device ID Card & Passport & Driver License Recognition SDK for Android
Stars: ✭ 223 (-46.52%)
Mutual labels:  ocr, passport
Inventory Kamera
Scans Genshin Impact characters, artifacts, and weapons from the game window into a JSON file.
Stars: ✭ 348 (-16.55%)
Mutual labels:  ocr, scanner
scanbot-sdk-example-ios
No description or website provided.
Stars: ✭ 17 (-95.92%)
Mutual labels:  ocr, scanner
QKMRZScanner
Scan MRZ (Machine Readable Zone) from identity documents (passport, id, visa) using iPhone/iPad (iOS)
Stars: ✭ 81 (-80.58%)
Mutual labels:  scanner, passport
Document-Scanner-and-OCR
A simple document scanner with OCR implemented using Python and OpenCV
Stars: ✭ 31 (-92.57%)
Mutual labels:  ocr, scanner
scanbot-sdk-example-ionic
Scanbot scanner SDK example app for Ionic with Cordova.
Stars: ✭ 24 (-94.24%)
Mutual labels:  ocr, scanner
Bottleneckosmosis
瓶颈渗透,web渗透,red红队,fuzz param,注释,js字典,ctf
Stars: ✭ 368 (-11.75%)
Mutual labels:  scanner
Mayan Edms
Repository mirror of GtLab: https://gitlab.com/mayan-edms/mayan-edms Please use the upstream repository for issues and pull requests.
Stars: ✭ 398 (-4.56%)
Mutual labels:  ocr
Ladongo
Ladon Pentest Scanner framework 全平台LadonGo开源内网渗透扫描器框架,使用它可轻松一键批量探测C段、B段、A段存活主机、高危漏洞检测MS17010、SmbGhost,远程执行SSH/Winrm,密码爆破SMB/SSH/FTP/Mysql/Mssql/Oracle/Winrm/HttpBasic/Redis,端口扫描服务识别PortScan指纹识别/HttpBanner/HttpTitle/TcpBanner/Weblogic/Oxid多网卡主机,端口扫描服务识别PortScan。
Stars: ✭ 366 (-12.23%)
Mutual labels:  scanner
K8tools
K8工具合集(内网渗透/提权工具/远程溢出/漏洞利用/扫描工具/密码破解/免杀工具/Exploit/APT/0day/Shellcode/Payload/priviledge/BypassUAC/OverFlow/WebShell/PenTest) Web GetShell Exploit(Struts2/Zimbra/Weblogic/Tomcat/Apache/Jboss/DotNetNuke/zabbix)
Stars: ✭ 4,173 (+900.72%)
Mutual labels:  scanner
Handwriting Ocr
OCR software for recognition of handwritten text
Stars: ✭ 411 (-1.44%)
Mutual labels:  ocr
Baiduyun deeplearning competition
百度云魅族深度学习应用大赛
Stars: ✭ 393 (-5.76%)
Mutual labels:  ocr
Camera
二代身份证信息识别
Stars: ✭ 360 (-13.67%)
Mutual labels:  ocr

PassportScanner

Works with 2 and 3 line identity documents.

Build Status Issues Stars Version License Platform Documentation

Git Twitter LinkedIn eMail

What is this

With PassportScanner you can use your camera to scan the MRZ code of a passport. It will extract all data like firstname, lastname, passport number, nationality, date of birth, expiration date and personal numer. Theres is Support for the TD1 and TD3 format (2 or 3 lines)

IMPORTANT NOTICE: SCANNING IDENTITY DOCUMENTS IS IN MOST CASES RESTRICTED BY LAW. OBSERVE THE APPLICABLE LAWS USING THIS TOOL. THE COPYRIGHT HOLDER IS NOT IN ANY WAY LIABLE FOR UNLAWFUL USAGE OF THIS TOOL.

PassportScanner is trying to optimize OCR results by first performing some graphic filters. The exposure filter is dynamic. This means that if the image is dark it tries to light it up and visa versa. As you can see in the demo animation below you will be able to scan a passport about once every 3 seconds.

wait a moment until the .gif below is downloaded...

animated

Building the PassportScanner demo

The current version is tested with Xcode 11.3, Swift 5

  1. Clone the repo to a working directory

  2. CocoaPods is used to manage dependencies. Pods are setup easily and are distributed via a ruby gem. Follow the simple instructions on the website to setup. After setup, run the following command from the toplevel directory of PassportScanner to download the dependencies:

pod install
  1. Open the PassportScanner.xcworkspace in Xcode.

  2. Build and Run the app.

External components for the demo

PassportScanner is using the following components which can be installed using CocoaPods.

  • TesseractOCRiOS Tesseract OCR iOS is a Framework for iOS7+.
  • GPUImage An open source iOS framework for GPU-based image and video processing
  • UIImage-Resize Category to add some resizing methods to the UIImage class, to resize it to a given CGSize — or fit in a CGSize keeping aspect ratio

Using PassportScanner in your own App

'PassportScanner' is now available through the dependency manager CocoaPods. At this moment this can be installed by executing:

[sudo] gem install cocoapods

If you have installed cocoapods you can just add PassportScanner to your workspace by making sure the following lines are in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod "PassportScanner"

Add an import at the top of your swift file like this:

import PassportScanner

If you want support for older versions than iOS 8.0, then you can also just copy the Pod folder containing the 2 classes MRZ and PassportScannerController to your app. Also add the above mentioned external components to your podfile.

When PassportScanner is added to your project, then copy the PassportScanner view from the Main.storyboard of the demo app to your own storyboard. After that you can customize that view. Also copy the MyScanViewController.sift to your own project. See the ViewConroller.swift to see how you can initiate the view and get the MRZ data

also copy over the tessdata folder to our app. That folder contains the trained data for tesseract (The OCR engine)

Here is sample code for a PassportScannerController:

protocol ProcessMRZ {
    func processMRZ(mrz:MRZ)
}

class MyScanViewController: PassportScannerController {

    var delegate: ProcessMRZ?

    // the .StartScan and .EndScan are IBOutlets and can be linked to your own buttons

    // For now just start scanning the moment this view is loaded
    override func viewDidLoad() {
        super.viewDidLoad();
        self.debug = true // So that we can see what's going on (scan text and quality indicator)
        self.accuracy = 1  // 1 = all checksums should pass (is the default so we could skip this line)
        self.mrzType = .auto // Performs a little better when set to td1 or td3
        self.showPostProcessingFilters = true // Set this to true to to give you a good indication of the scan quality
        self.StartScan(self)
    }
    
    override func succesfullScan(mrz: MRZ) {
        print("mrz: {\(mrz.description)\n}")
        delegate?.processMRZ(mrz)
        self.dismissViewControllerAnimated(true, completion: nil)
    }

    override func abbortScan() {
        self.dismissViewControllerAnimated(true, completion: nil)
    }
}

Then in your own code you can access this PassportScannerController and process the MRZ data with something like this:

class ViewController: UIViewController, ProcessMRZ {

    @IBOutlet weak var mrzLabel: UILabel!

    override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
        return UIInterfaceOrientationMask.Portrait
    }

    override func prefersStatusBarHidden() -> Bool {
        return true
    }

    @IBAction func StartScan(sender: AnyObject) {
        let storyboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
        let scanVC: MyScanViewController = storyboard.instantiateViewControllerWithIdentifier("PassportScanner") as! MyScanViewController
        scanVC.delegate = self
        self.presentViewController(scanVC, animated: true, completion: nil)
    }

    func processMRZ(mrz:MRZ) {
        self.mrzLabel.text = mrz.description
        mrzLabel.sizeToFit()
    }
}

License

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

My other libraries:

Also see my other open source iOS libraries:

  • EVReflection - Reflection based (Dictionary, CKRecord, JSON and XML) object mapping with extensions for Alamofire and Moya with RxSwift or ReactiveSwift
  • EVCloudKitDao - Simplified access to Apple's CloudKit
  • EVFaceTracker - Calculate the distance and angle of your device with regards to your face in order to simulate a 3D effect
  • EVURLCache - a NSURLCache subclass for handling all web requests that use NSURLReques
  • AlamofireOauth2 - A swift implementation of OAuth2 using Alamofire
  • EVWordPressAPI - Swift Implementation of the WordPress (Jetpack) API using AlamofireOauth2, AlomofireJsonToObjects and EVReflection (work in progress)
  • PassportScanner - Scan the MRZ code of a passport and extract the firstname, lastname, passport number, nationality, date of birth, expiration date and personal numer.
  • AttributedTextView - Easiest way to create an attributed UITextView with support for multiple links (url, hashtags, mentions).
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].