Nowadays, lots of mobile applications like Office Lens and Genius Scan can turn a physical document into a digital one using only a phone—you actually no longer need to have a bulky, costly scanner.

Let’s imagine you want to extract text from the scanned document…easy right? Well, not exactly—it’s actually one of the most challenging problems in computer vision.

In this article, I’ll first provide an overview of OCR (optical character recognition), which is the main technology used to solve this problem, and then I’ll compare two main libraries that use OCR to detect and recognize characters from a given image. Both are on-device tools, and they’re both made by two giants: Google and (more recently) Apple.

But before that, let’s understand what optical character recognition means.

What is OCR?

OCR is a system that allows you to scan a text or document that can be edited on your smartphone or on your computer.

The OCR system corresponds to the automated recognition of printed texts, and to their re-transcription in an electronic file. By scanning a document, the device is able to “read” the content.

OCR systems can recognize different types of fonts and different types of typewriters, but also computers. Some OCR systems can even identify handwriting.

The text that a smartphone or computer reads from a scanned document can then be used to automatically fill out a form, for instance. This is the case when you register a fee on billing software.