Templates

Handwriting OCR Pipeline

Deskew, binarise, segment, recognise, correct.

Handwriting OCR pipeline transcribing a photographed handwritten page with corrections highlighted

A transcription pipeline for real-world documents rather than clean scans: automatic deskewing, adaptive binarisation that survives uneven lighting, line segmentation, per-line recognition, and lexicon-based correction with character error rate reporting so you know whether the output is worth reviewing.

What is inside

  • Automatic deskewing before segmentation, which is where most pipelines quietly fail
  • Adaptive binarisation and denoising for photographs rather than scans
  • Ruled-line removal via morphological opening, preserving letter strokes
  • Projection-based line segmentation with per-line recognition
  • Domain lexicon correction that only auto-fixes unambiguous matches
  • Character error rate reporting per page, so quality is measurable

Built with

  • Python
  • OpenCV
  • PyTorch
  • Transformers
  • FastAPI
Next step

Have an AI problem worth solving?

Tell me what you are trying to build. I will tell you honestly whether AI is the right tool, what it would take, and how I would approach it.

Typical reply within 24 hours

Working from Dhaka, Bangladesh · remote worldwide