ScanID - Homework iOS project to scan IDs MRZ code

Related tags

Bluetooth ScanID
Overview

ScanID

Homework iOS project to scan IDs MRZ code

Requirements for mobile application

  1. Create app for ID document photo capturing, just the side with MRZ (https://en.wikipedia.org/wiki/Machine-readable_passport)
  2. Pass photo to API, You can use your own document or take pictures from the internet. Use "data" information from api call response.
  3. Present received information in a tidy manner.
  4. Briefly describe your process and how the app works.

Special focus should be on solving one of these problematic areas:

  • quality of photo (detect blur, glare, darkness, ...)
  • not readable information (try to read some data from document)
  • document not in frame

Optional, but it would be good to address these requirements: Use one of MVVM/MVP design patterns. Write some unit tests.

Main purpose of this task is to check your logical thinking and code writing, not on completely solving these problems, so do not take too much time if it doesn't work 100%.

Brief description on my process

The project consists of main app target ScanID and inner module DocummentScanner, supports iOS 14.1+ and uses SPM as dependency manager. ScanID app was developed as an experimental SwiftUI-MVVM project while learning basics and features of Swift Combine framework.

I started with the special focus section which was creating basic MRZ reader by using 3rd party framework MRZSccanner and reusing UIKit ViewController from provided sample app by adjusting few parts with 'quick and dirty' a.k.a prototype approach, then I wrapped it into a SwiftUI view (here I lost a day or so, thats why mentioned ViewController is a singleton now) and it became a module which is decoupled from the app and can be replaced with any other scanner implementation.

DocumentScanner module solves the problematic areas like quality of photo, blur, glare, darkness etc. since it continuously reads MRZ and emits a Boolean whether document is readable well. This emitter is tied to a button on UI not allowing user take photos when MRZ is not in frame or unreadable.

Furthermore, I continued with main app by creating API layer using a lightweight swift networking library and which also resulted in some work in Scanner viewmodel to consume mentioned API - at this stage requirement #2 is complete. After this some more tinkering with combine to pass the API response down to another view and we are complete with point #3, data is presented. #4 Brief description is above and #1 is creating the app, see below...

How the app works

After accepting the Camera permission app displays camera preview and user can try scanning an LT or LV ID card back side, until its done properly, app will display text "try finding better angle". Or try this dummy ID.

Once user aligns document with camera frame or at least in a distance camera can read it, text on the button will change to "Take photo" until user moves away from the acceptable capture. If user was able to capture the ID, an image preview will appear below, the camera feed will keep running, user can retake pictures, that will overwrite previous capture.

By tapping on "Use this photo" modal sheet is brought up and photo data is sent to the API for validation, once response comes back, the loading text is replaced either with error or list of validated API data, yumm.

Improvement areas:

  • That messy ViewController for camera preview
  • Error handling
  • Tests for JSON parsing
  • Tests for ViewModel reactions on various inputs
  • Auto detect document type and map it to API type
  • Test on various doc types - aspect ratios are hardcoded :|
You might also like...
Library for scanning documents via MRZ (Machine Readable Zones) using  Vision API

MRZScanner Library for scanning documents via MRZ using  Vision API. Example The example project is located inside the Example folder. To run it, you

Swift Xid - Xid uses MongoDB Object ID algorighm1 to generate globally unique ids with base32 serialzation to produce shorter strings

Swift Xid - Xid uses MongoDB Object ID algorighm1 to generate globally unique ids with base32 serialzation to produce shorter strings

Homework on the iOS development course at TeachMeSkills
Homework on the iOS development course at TeachMeSkills

TMS_HW16 Домашнее задание на курсе по iOS-разработке в TeachMeSkills Грамматика преподавателя сохранена Основное Разноцветные ячейки в таблице. В кажд

UICollectionView and UIStackView Homework
UICollectionView and UIStackView Homework

UICollectionView and UIStackView Homework Use one outer StackView containing one CollectionView on top and a horizontal StackView at the bottom with t

You will learn how to scan QR code with iOS framework.
You will learn how to scan QR code with iOS framework.

QR Code Scanner You will learn how to scan QR code with in iOS without using any library. It is as simple to scan QR code in iOS. In this example, We

A Simple iOS QR code scanner that allows users to enable their camera and local Photo Library accesses to scan the contents of the input QR codes.

iOS QR Code Scanner A Simple iOS QR code scanner using Swift UI. Jump to: ContentView.swift screenshot 1.1.5 NOTE: be aware of the new horizontal line

KYC-iOS-Native - To Scan Doc and Validate KYC

KYC-iOS-Native Example To run the example project, clone the repo, and run pod i

🔍BarcodeScanner – simple & easy application that helps you to scan both EAN8 and EAN13 barcodes.
🔍BarcodeScanner – simple & easy application that helps you to scan both EAN8 and EAN13 barcodes.

🔍 Simple & easy application that helps you to scan both EAN8 and EAN13 barcodes.

A swift SDK to help you scan debit/credit cards.

SKCardReader A swift SDK to help you scan debit/credit cards. Requirements To use the SDK the following requirements must be met: Xcode 11.0 or newer

A convenient class usable from UIKit view controller or SwiftUI to scan document & get UIImage or PDFDocument as result - Replacement of IRLDocumentScanner

Super easy SwiftUI & UKKit pakcage to scan: Images or PDF. It is also a replacement for IRLScannerViewController

When you scan the clothing tag, a 3D character appears and informs you of the clothing information.
When you scan the clothing tag, a 3D character appears and informs you of the clothing information.

1. Introduction When you scan the clothing tag, a 3D character appears and tells you the information on the clothes. You can select necessary informat

A μlibrary in Swift containing all the countries with their localized name, ISO code, phone code, country code, flag image and emoji.

CountryKit CountryKit A μlibrary in Swift containing all the countries with their localized name, ISO code, phone code, country code, flag image and e

365-day-of-code - This repository has been opened for 365 days to code iOS with Swift

365 day of code This repository has been opened for 365 days to code iOS with Sw

Simple side/slide menu control for iOS, no code necessary! Lots of customization. Add it to your project in 5 minutes or less.
Simple side/slide menu control for iOS, no code necessary! Lots of customization. Add it to your project in 5 minutes or less.

▤ SideMenu If you like SideMenu, give it a ★ at the top right of this page. SideMenu needs your help! If you're a skilled iOS developer and want to he

Starter code for the Flash Chat project in the Complete iOS Development Bootcamp
Starter code for the Flash Chat project in the Complete iOS Development Bootcamp

Flash-Chat Our Goal One of the most fundamental component of modern iOS apps is the Table View. Table Views are used everywhere from the Mail app to t

iOS localization swift code generation project

code-gen-library - localization-swift module code-gen-library - localization-swift module with Python bash script execute to localization swift files(

Starter project for the iOS code challenge

iOS Base Project for Podium Take-Home Challenge Introduction We have provided two version of this base project: one using UIKit, one using SwiftUI. Th

Third Prize for Uber Hackathon China 2016. Source code for iOS client of UberGuide Project.
Third Prize for Uber Hackathon China 2016. Source code for iOS client of UberGuide Project.

Smart Traveller Intro It's the project we did for Uber Hackathon China 2016. This is the repo for iOS client. Using swift and Objective-C. The project

A tool for Swift code modification intermediating between code generation and formatting.

swift-mod A tool for Swift code modification intermediating between code generation and formatting. Overview swift-mod is a tool for Swift code modifi

Owner
Artūrs Āre
iOS developer
Artūrs Āre
iOS Bluetooth LE framework

Features A futures interface replacing protocol implementations. Timeout for Peripheral connection, Service scan, Service + Characteristic discovery a

Troy Stribling 696 Dec 25, 2022
BluetoothKit Easily communicate between iOS devices using BLE.

BluetoothKit Easily communicate between iOS devices using BLE. Background Apple mostly did a great job with the CoreBluetooth API, but because it enca

Rasmus Høhndorf Hummelmose 2.1k Jan 8, 2023
The easiest way to use Bluetooth (BLE )in ios,even bady can use.

The easiest way to use Bluetooth (BLE )in ios,even bady can use.

刘彦玮 4.6k Dec 27, 2022
Blocks Based Bluetooth LE Connectivity framework for iOS/watchOS/tvOS/OSX. Quickly configure centrals & peripherals, perform read/write operations, and respond characteristic updates.

ExtendaBLE Introduction ExtendaBLE provides a very flexible syntax for defining centrals and peripherals with ease. Following a blocks based builder a

Anton 94 Nov 29, 2022
AZPeerToPeerConnectivity is a wrapper on top of Apple iOS Multipeer Connectivity framework. It provides an easier way to create and manage sessions. Easy to integrate

AZPeerToPeerConnection Controller Features Multipeer Connectivity Connection via Bluetooth or Wifi No need write all session, browser, services delega

Afroz Zaheer 66 Dec 19, 2022
Fluetooth - Flutter library for sending bytes to Bluetooth devices on Android/iOS

A Flutter library for sending bytes to Bluetooth devices. Available on Android a

Iandi Santulus 1 Jan 2, 2022
The Bluetooth LE library for iOS and Mac. 100% Swift.

iOS-BLE-Library An in-development Bluetooth Low Energy Library by Nordic Semiconductor to interact with the , which is not complicated, but requires w

Nordic Semiconductor 6 Dec 19, 2022
Scan the MRZ code of a passport and extract the firstname, lastname, passport number, nationality, date of birth, expiration date and personal numer.

PassportScanner Works with 2 and 3 line identity documents. What is this With PassportScanner you can use your camera to scan the MRZ code of a passpo

Edwin Vermeer 441 Dec 24, 2022
Project The Light homework #1

The Light Project The Light homework #1 1. App icon added 2. When the applicatio

Nikita 0 Dec 19, 2021
Custom Beautiful UIView For Handling IDs in iOS

IDView Custom Beautiful UIView For Handling IDs in iOS Setup Set the placeholder images for the front and back faces. override func viewDidLoad()

Omar Labib 6 Aug 21, 2021