Smart Document Scanner in Python
A real-time, local Python computer vision pipeline and interactive scanner studio using OpenCV, NumPy, and local OCR.
A real-time, local Python computer vision pipeline and interactive scanner studio using OpenCV, NumPy, and local OCR. Automatically detects document boundaries, orders quadrilateral corners clockwise, flattens slanted perspective distortions, crops desk backgrounds, cleans readability using adaptive thresholding, extracts structured text via OCR, and compiles multi-page sessions into consolidated PDFs.
- Full Python OpenCV document digitization pipeline running 100% locally on-device with zero cloud latency or privacy exposure
- Four-corner geometric coordinate ordering algorithm (The Clue) sorting points clockwise via (x+y) sums and (y-x) differences to eliminate inversion
- Automated Douglas-Peucker convex contour approximation and homography perspective transformation mapping slanted papers to flat rectangular scans
- Unnecessary desk, keyboard, and background cropping with illumination shadow flattening
- Adaptive Gaussian thresholding, Otsu binarization, and CLAHE grayscale enhancement producing crisp black ink on pure white paper
- Local multi-line and multi-paragraph OCR text extraction with confidence telemetry and UTF-8 export
- Multi-page batch session manager compiling individual page scans into a unified 300 DPI PDF document
- Interactive Web Showcase Studio featuring simulated camera feed, detected orange corner pins, real-time perspective flattener, and 8-point automated diagnostic suite
Built with: Python 3.12, OpenCV, NumPy, Pillow, Douglas-Peucker Polygon Approximation, Homography Perspective Transform, Four-Corner Coordinate Ordering, Adaptive Gaussian Thresholding, Local On-Device OCR, Multi-Page Session Management, Consolidated PDF Compilation, HTML5 / Canvas / Vanilla JS