Skip to content
StackDecode
AI & ML Atlas
Artificial IntelligencealgorithmAnimated walkthrough

Optical Character Recognition

Turns images of text into machine-readable characters.

The idea

OCR first finds where the text is, then reads it. Classic pipelines binarise the page, split it into lines and characters and classify each glyph. Modern ones use a CNN to encode line images and a recurrent or transformer decoder (often with CTC loss) to output the whole string without explicit character splitting.

Watch it run

The pipeline lights up one step at a time. Use the controls to pause or step through it.

  1. 1Pre-process: deskew, remove noise, binarise.
  2. 2Detect text regions and lines.
  3. 3Extract visual features with a CNN.
  4. 4Decode features into characters (CTC or attention).
  5. 5Post-process with a dictionary or language model.
1/5

Step by step

  1. 1Pre-process: deskew, remove noise, binarise.
  2. 2Detect text regions and lines.
  3. 3Extract visual features with a CNN.
  4. 4Decode features into characters (CTC or attention).
  5. 5Post-process with a dictionary or language model.

Where it is used

Document digitisation, licence plates, receipts, accessibility.

Watch out for

Poor scans, handwriting, unusual fonts and complex layouts.

Related