COMPUTER VISION

Scan Restoration & Preprocessing: Radon Deskewing, Otsu Binarization & Upscaling

Real-world document digitization rarely begins with pristine, professionally scanned master pages. Smartphone camera captures with ambient perspective skew, faded thermal store receipts, wrinkled contracts, and low-resolution 72 DPI faxes present severe challenges for optical character recognition systems. Automated computer vision preprocessing restores degraded documents before text extraction.

1. Radon Transform Rotational Deskewing

When paper sheets travel through automatic document feeder (ADF) rollers or are captured handheld, angular skew is virtually inevitable. Even a modest 1.5° tilt causes horizontal bounding boxes to slice through adjacent text lines, splicing sentences together into illegible text:

freeOCR.me computes the mathematical Radon transform, projecting image pixel intensity integrals along radial lines across angular steps of 0.1° spanning −15° to +15°:

  • Variance Baseline Peak: Because parallel printed text lines create sharp peaks of dark and light alternating contrast, projecting parallel to text baselines maximizes intensity variance.
  • Sub-Degree Orientation Detection: The projection angle exhibiting maximum mathematical variance corresponds precisely to document orientation.
  • Bicubic Mirror Rotation: The image buffer is rotated using bicubic interpolation with boundary mirroring, correcting rotation without clipping margin characters.

2. Local Adaptive Otsu Binarization

Global thresholding algorithms calculate a single luminance cutoff for an entire page. This fails catastrophically on wrinkled papers, faded thermal receipts, or pages with shadow gradients across the book spine. freeOCR.me applies localized adaptive binarization:

  • Localized Sliding Window: The raster image is divided into dynamic sub-windows (15x15 to 31x31 pixels).
  • Dynamic Threshold Calculation: Threshold cutoffs are computed independently for each region based on local mean luminance and standard deviation.
  • Contrast Enhancement: Faded character strokes on thermal receipt paper are separated from background yellowing while dark gutter shadows are suppressed.
💡
Camera Capture Pro-Tip:

When digitizing paperwork with mobile smartphone cameras, ensure the document fills at least 85% of the viewport and avoid direct flashlight reflection hotspots that saturate paper white levels.

3. Lanczos-4 Sinc Interpolation for Low-DPI Upscaling

Neural OCR models are trained on character topologies normalized for 300 DPI resolution. Low-resolution faxes (72 to 100 DPI) cause character loops to merge. Our preprocessor detects sub-optimal resolutions and executes Lanczos-4 sinc windowed interpolation, reconstructing smooth glyph edges and preserving character loops before neural tokenization.

Try freeOCR.me 100% Free

Convert your scanned PDFs, receipts, and images to dual-layer searchable PDFs and Structured Markdown with ephemeral RAM security.

âš¡ Convert Scanned Document Now