Dev.to AI 🤖 Ai 👁 0 📖 2 min read

Tesseract Read a Bank Statement and Silently Dropped the Decimal Point in 3 Amounts

I keep seeing "just OCR it" in threads about invoices, receipts and bank statements. So I ran plain Tesseract (eng, default settings, no preprocessing) on a handful of public test images, including a bank statement, and

I keep seeing "just OCR it" in threads about invoices, receipts and bank statements. So I ran
plain Tesseract (eng, default settings, no preprocessing) on a handful of public test images,
including a bank statement, and compared every number it returned with the image.

The headline

The bank statement came back with a confidence of 83 and text that looks perfect at a
glance. Three amounts out of about twenty-five lost their decimal point:

image says Tesseract returned
14.54 1454
32,414.50 3241450
70.51 7051

No warning, no low-confidence marker on those lines, nothing in the output that tells you
which numbers to distrust. 14.54 became 1454: a 100× error that will happily sum in a
spreadsheet.

It also flattened the table: Debits and Credits are separate columns in the image, but the
text has one number per line with no column, so you can't tell a debit from a credit without
re-parsing the layout yourself.

What it handled well

  • Clean printed text: a scanned poem and a test paragraph came back word-perfect at confidence 92–94.
  • Rotated images: the same image rotated 90° and 180° still came back as Tesseract.js, confidence 91.
  • Speed and cost: nine images across two runs took under 9 seconds and well under a tenth of a cent of compute.

Two quieter failures

  • It "fixed" a deliberate zero. The test image says Hell0 World with a zero; Tesseract returned HellO, with a letter O. Fine for prose, wrong for serial numbers, codes and IDs.
  • Wrong language = garbage with a tell. A Traditional Chinese image read with eng returned FRET OCHE at confidence 0. That one, at least, is easy to catch: a confidence of 0 almost always means the wrong language model (it needs chi_tra).

My takeaways

  1. Confidence is per image, not per number. An 83 says nothing about which amount is wrong.
  2. For money, validate. Check that balances add up row by row; the three errors above all break the running balance, so a simple check would have caught them.
  3. Tables need layout, not just text. If columns matter, use word boxes/positions, or a tool built for tables.
  4. Set the language. eng+fra, deu, ron, chi_tra… and treat confidence 0 as "wrong language", not "empty image".

If you want to try the same thing

The setup above runs as an Apify Actor: a list of image URLs in, one row per image with
text, confidence, words, lines out; images without text are not billed. $2.50 per
1,000 images with text: Image OCR — Extract Text from Images in Bulk.
The cheatsheet with the Tesseract commands and the validation checks is on GitHub:
noble-ronin/tesseract-ocr-pitfalls.

Your turn

What do you put after OCR when the numbers matter: balance checks, a second OCR engine, an
LLM pass, a human? I'm curious which one actually catches the dropped-decimal case in practice.

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.