lizadaly / page-scan-corrector

Utility for using opencv to detect and reformat page scans, as for OCR

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Page Scan Corrector

Utility for using opencv to detect and reformat page scans, as for OCR.

The program will attempt to crop an image (PNG, JPG) to only major text sections. Preserves color.

Installation

Prerequisites

You'll need to install OpenCV on your platform. This does not require a bleeding-edge version, so using a package manager version should work (e.g. brew install opencv on a Mac).

pipenv install
setup.py install --editable .

Running from the command-line

process_image input.png outdir

This will write outdir/input.png with the result.

Examples

Input file

Input file

Output file

Output file

References

This was originally forked from doc2text.

About

Utility for using opencv to detect and reformat page scans, as for OCR

License:MIT License


Languages

Language:Python 100.0%