Skip to content

kapitsa2811/DocProj

 
 

Repository files navigation

DocProj

The source code of Document Rectification and Illumination Correction using a Patch-based CNN by Li et al, to appear at SIGGRAPH Asia 2019.

Prerequisites

  • Linux or Windows
  • Python 3
  • CPU or NVIDIA GPU + CUDA CuDNN

Getting Started

Dataset Generation

We use Blender to automatically generate synthetic distorted document image and the corresponding flow.

You can download a sample dataset (438MB) from here and we are still working on how to find a good way to upload the full dataset since it is too large (65GB).

The dataset includes three folders: img (the distorted images), img_mask (the mask of background), flow (the forward flow of the distorted images).

The first thing you need to do is to crop the dataset to patches for training. Change arguments to your own and run the following commands. For help message about optional arguments, run python xxx.py --h

python local_patch.py   # crop images and flows to local patches and local patch flows
python global_patch.py  # crop images to global patches

Training

Run the following command for training and change the optional arguments like dataset directory, etc.

python train.py

Use a Pre-trained Model

You can download the pre-trained model here.

About

Document Rectification and Illumination Correction using a Patch-based CNN

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%