On-Device Document Edge Detection and Image Optimization in NVIN Scanner
Digitizing paper documents with a smartphone camera sounds trivial until you consider the real-world conditions: uneven lighting, shadows cast by the user's hands, crumpled paper receipts, and tilted camera angles.
With NVIN Scanner, our goal was to deliver crystal-clear document scans directly on-device without shipping photographs to cloud servers for remote post-processing.
Contour Detection and Perspective Correction
Our pipeline applies an adaptive thresholding pass to identify the quadrilateral boundary of the physical paper. Once the four corner coordinates are resolved, a projective perspective transformation is computed to map the skewed rectangle into an upright, undistorted plane.
Contrast & High-Pass Filtering
To turn grayish camera captures into crisp, printable black-and-white documents, we apply a localized background normalization filter that eliminates shadows while preserving delicate handwriting and rubber-stamp ink.
Integrated Local PDF Compilation
Rather than requiring users to jump between external web converters, NVIN Scanner compiles multiple scanned pages directly into a single compressed PDF file within the local Android file storage.