Case // 09
OCR pipeline
From a scanned page to searchable text, with a confidence score for every word.
Fact sheet
A self-contained demonstration of Tesseract 5.4 driven from Python: plain text, word boxes with confidence, page segmentation modes, hOCR and searchable PDFs with an invisible text layer.
- Context
- R&D lab
- Role
- Research and development
- Team
- Solo
- Period
- 2026
- Status
- Prototype
- 95%mean word confidence on the sample page
- 4output formats
Challenge
01Choose and tune an OCR approach for document digitisation: how reliable is each word, how should a page with columns be segmented, and how do you hand the results to other systems?
Approach
02A Python script generates its own test pages, then walks through the engine: image_to_string for text, image_to_data for word-level boxes and confidence, a comparison of page segmentation modes on a two-column layout, hOCR export, and a searchable PDF built with reportlab.
Outcome
03A reusable reference for OCR work, with measured confidence (95% on average on the sample page) and the output formats that downstream systems need.
Architecture
SCHEMA- Input
- Page imageRendered or scanned page
- Engine
- PillowLoad and prepare
- Tesseract 5.4LSTM engine, PSM modes
- Outputs
- Plain textimage_to_string
- Word dataBoxes and confidence
- hOCRStructured HTML
- Searchable PDFInvisible text layer
Swipe sideways to explore the diagram
What I did
- Word-level bounding boxes and confidence, drawn on the page for human review
- Side-by-side comparison of page segmentation modes on complex layouts
- hOCR and searchable PDF outputs for archives and search engines
- LSTM engine with multilingual language packs
Stack
- AI
- Tesseract 5.4 (LSTM)
- pytesseract
- Back end
- Python
- Pillow
- reportlab
Related services
Need something similar? These are the services this project demonstrates.
Get in touch