DEV Community

Rex Serubii
Rex Serubii

Posted on

Reading ID Cards using your camera

Last Year, I made an android application that allows you to scan Passports and ID cards with your camera and extract all the data from the card's machine readable zones; it was pretty fun to optimize and implement!

Link to Code

GitHub logo ultimaterex / Zone-Reader

Simple app that reads identification documents

Zone Reader

Zone Reader is an Android based identification reader application, written in kotlin using firebase and google libraries.

features

  • Supports reading from most valid ICAO 9303 documents.
  • Supports saving and sharing read data to common formats.

Libraries

Zone Reader uses a number of open source projects to work properly:

  • Dexter- Permissions made easy
  • Firebase - Is what makes this all run.
  • Glide - The best image loader I've used so far
  • CameraX - Great camera class by Google
  • Camera Kit - Fallback camera class

Build for yourself

This app requires you to add your own api key and google-services.json, then build it through android studio




How I Built It

I ended up writing it fully in Kotlin in android studio, with Sourcetree as my GUI Git tool. I decided to use Firebase for my OCR and the new alpha CameraX builds to allow it to work without any manual input from the user.
My initial builds used the CameraKit library to provide basic camera capture for my use case. Once I had figured out how to use the CameraX library, I decided to move it over as a fallback implementation so I didn't have to deprecate it completely.

Honestly, getting used to the CameraX library with Firebase was a pretty large undertaking since it's still in alpha, but the results were worth it for "on the fly analyzation". I chose to fully write the project in Kotlin, so I could get used to the language.

Some libraries I used while making it:

  • Dexter- Permissions made easy.
  • Firebase - What makes this all run.
  • Glide - The best image loader I've used so far.
  • CameraX - A great camera class by Google.
  • Camera Kit - Fallback camera class.

Additional Thoughts

Honestly, building this project gave me a newfound love for Kotlin and how easy it was to transition from Java. I would consider writing in Kotlin again for future projects.

Top comments (3)

Collapse
 
lisasanderson profile image
LisaSanderson • Edited

Yeah, creating an Android app to scan and extract data from passports and ID cards does sound really cool! It's amazing how technology can make our lives easier, right? The optimization and implementation process must have been quite challenging, but also rewarding. By the way, have you heard about the recent concerns regarding fake IDs? It's important to stay cautious and ensure we're using legitimate identification sources. Agree that sometimes we really need fake IDs. Recently, thanks to fakeyourdrank.com, I received such an ID card.

Collapse
 
aidanbray profile image
AidanBray

Hey, that sounds awesome! Creating an Android app that can scan and extract data from passports and ID cards must have been a cool project. Optimizing and implementing it sounds like a fun challenge too

Collapse
 
isai_arellano_x profile image
Isaí Arellano

Hello friend, I would like to create something like this but for Mexican IDs, but detecting the card and capturing the image could you support me