← all work classical-computer-vision

Document scanner

[![Python 3.10+](https://img.shields.io/badge/python-3.10+-3776AB?logo=python&logoColor=white)](https://www.python.org/)

Result

SrDocumentCanny + contourOtsu + contourMorph gradient**Saturation (HSV)**Hough linesminAreaRect
1motion-blurred text · real2.7 px1.6 px2.0 px**0.6 px**1.7 px47.9 px
2till receipt · generated2.5 px1.0 px1.4 px**0.6 px****76.3 px**13.8 px
3sudoku · real**FAILED****70.1 px**25.3 px**1.0 px****231.3 px**28.0 px
4ruled form · generated3.1 px1.3 px1.7 px**1.2 px**2.2 px11.5 px

The finding

What it does

`mermaid flowchart LR A[Photo of a page
angled, cluttered desk, uneven light] --> B[1 · Detect the page
6 methods compared] B --> C[2 · Recover aspect ratio
closed form from perspective] C --> D[3 · Rectify
homography warp] D --> E[4 · Binarise
4 methods compared] E --> F[Flat, readable scan] `

Each stage is scored against exact ground truth, not judged by eye:

---

Elsewhere

Code and full results on GitHub (code private)

Every number is read from the file the run produced. github.com/hammasbuilds · kaggle.com/muhammadhammas13