Scan Aligner
This is a tool for automatically aligning scanned copies of some source template.
This was motivated by the need to align answer sheets for exams before uploading them to Gradescope to make automatic grading easier and more accurate.
It consists of two scripts:
align.py
, which takes a template PDF and a PDF containing scanned pages, and outputs a PDF with the scanned pages each transformed to align with the template PDFadd_marker.py
, which takes a template PDF and adds the fiducial markers necessary for alignment
Installation
Requires Python 3. Install the required dependencies with pip install -r requirements.txt
.
This tool also needs pdftoppm
, which is a component of Poppler. You can install it on macOS with Homebrew: brew install poppler
.
Usage
python3 align.py <path to template PDF> <path to the scanned PDF> [--output <path to save output PDF>]
python3 add_marker.py <path to input PDF> <path to save output PDF>
Example
For an example, see the example/
folder.