▶ Sign up free for the video, slides & prompts
The lesson below is open to all. Enter your email once to unlock every video, slide deck, prompt and code example on this device.
Checking…
Computer Vision in Practice · Lesson 11 of 15 · 2 min read · 5 min video
OCR and document AI
Read text from receipts, forms and Indian ID documents reliably.
📄 Download slides (PDF)· free sign-upA huge amount of real-world vision work is reading text: receipts, invoices, forms, number plates and ID cards. OCR (optical character recognition) turns pictures of text into text you can search and process.
The OCR pipeline
- Preprocess: fix rotation and perspective, improve contrast, remove shadows
- Detect text: find where the words and lines are
- Recognise: read the characters in each region
- Post-process: fix common mistakes, join lines and pull out the fields you need
Tools
- Tesseract: free and classic. Good on clean, printed scans
- EasyOCR and PaddleOCR: deep-learning OCR that handles photos and many languages, including Telugu and Hindi
- Cloud services: Google Document AI, AWS Textract and Azure Document Intelligence. Strong on forms and tables, but you pay per page
From text to fields
Reading the text is only half the job. Usually you want structured data: the bill number, date, GSTIN and total.
- Rules and regular expressions work for fixed formats, like a 15-character GSTIN
- Layout-aware models such as LayoutLM use both the text and its position on the page
- Multimodal LLMs can extract fields straight from an image into JSON, but validate the results
Handle sensitive documents carefully
Aadhaar, PAN cards and bank statements contain personal data. Under the DPDP Act:
- Collect only what you need, and get clear consent
- Mask numbers you don't need, such as all but the last four Aadhaar digits
- Encrypt stored images, and delete them when they're no longer needed
In one line
OCR finds and reads text in images, and document AI turns it into validated, structured fields, while sensitive documents need consent, masking and careful storage.
Share with a friend