[](https://www.python.org/)
| Sr | Document | Canny + contour | Otsu + contour | Morph gradient | **Saturation (HSV)** | Hough lines | minAreaRect |
|---|---|---|---|---|---|---|---|
| 1 | motion-blurred text · real | 2.7 px | 1.6 px | 2.0 px | **0.6 px** | 1.7 px | 47.9 px |
| 2 | till receipt · generated | 2.5 px | 1.0 px | 1.4 px | **0.6 px** | **76.3 px** | 13.8 px |
| 3 | sudoku · real | **FAILED** | **70.1 px** | 25.3 px | **1.0 px** | **231.3 px** | 28.0 px |
| 4 | ruled form · generated | 3.1 px | 1.3 px | 1.7 px | **1.2 px** | 2.2 px | 11.5 px |
`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:
---
Code and full results on GitHub (code private)
Every number is read from the file the run produced. github.com/hammasbuilds · kaggle.com/muhammadhammas13