animation/fourcell
Matt McWilliams 3d286cfd4d add documentation to fourcell 2024-01-10 09:43:32 -05:00
..
notes Completed generate text example. Can be tweaked now. 2023-03-16 00:03:47 -04:00
registrationMark Registration marks should be separated into different dpis 2023-02-12 10:02:55 -05:00
.gitignore Begin the calibrate script which will read the .txt file made by the normalize script. JSON would make more sense. 2022-11-24 11:22:03 -05:00
README.md add documentation to fourcell 2024-01-10 09:43:32 -05:00
apply_image.py Update --help in apply_image 2024-01-09 14:32:14 -05:00
apply_svg.py Update --help in apply_image 2024-01-09 14:32:14 -05:00
calibrate.py add documentation to fourcell 2024-01-10 09:43:32 -05:00
common.py Generate a calibration sheet 2023-02-21 22:18:14 -05:00
guide.py Refactor to use argparse. Add descriptions and comments for context 2024-01-03 13:19:04 -05:00
normalize.py Refactor to use argparse. Add descriptions and comments for context 2024-01-03 13:19:04 -05:00
requirements.txt Started analysis script with single example taken from stackoverflow as a starting point. Had to modify it to support opencv 4.x but got it to run. Finds holes. 2022-11-08 19:11:15 -05:00
template.py Refactor to use argparse. Add descriptions and comments for context 2024-01-03 13:19:04 -05:00
template_ratio.sh Move fourcell scripts into directory. Correctly orient ratio. 2023-03-14 08:22:13 -04:00
white_fourcell.sh Generate a guide, generated specifically for the sequence and template and use that as first frame. 2023-03-14 11:30:44 -04:00

README.md

Four Cell Scripts

Analysis Steps

  1. Locate positions of 6 hole punches - normalize.py
  2. Orient to square position - normalize.py
  3. Find all 4 fiducials
  4. Calculate their position relative to the hole punches
  5. Create a template
  6. Use the template-filling script to recreate calibration page as a proof to be checked on a lightbox

Page Hole Punch Order

   human           zero-index
_______________  _______________
|             |  |             |
| 1         3 |  | 0         2 |
|             |  |             |
|             |  |             |
|             |  |             |
| 2         4 |  | 1         3 |
|             |  |             |
|             |  |             |
|             |  |             |
| 5         6 |  | 4         5 |
|             |  |             |
---------------  ---------------

Calibration Layout Order

_______________  _______________ 
|             |  |             |
| 1   2 3   0 |  |             |
|             |  |   1     2   |
|             |  |             |
| 0   3 2   1 |  |             |
|             |  |             |
| 1   2 3   0 |  |             |
|             |  |             |
|             |  |   0      3  |
| 0   3 2   1 |  |             |
|             |  |             |
---------------  ---------------

normalize.py

Normalize a scanned hole punch image.

usage: normalize.py [-h] input output

positional arguments:
  input       Scan to normalize
  output      Normalized file to output

calibrate.py

Create a calibration file, apply to a scanned page, or scale image to desired DPI.

usage: calibrate.py [-h] [--dpi DPI] [--input INPUT] [--output OUTPUT] [--calibration CALIBRATION] {generate,calibrate,scale}

positional arguments:
  {generate,calibrate,scale}
                        The action to perform

options:
  -h, --help            show this help message and exit
  --dpi DPI, -d DPI     DPI to generate
  --input INPUT, -i INPUT
                        Input file
  --output OUTPUT, -o OUTPUT
                        Output file
  --calibration CALIBRATION, -c CALIBRATION
                        Calibration file

template.py

Create a template from normalized scan file.

usage: template.py [-h] normalized [registration]

positional arguments:
  normalized    Normalized scan to build template from.
  registration  Registration mark to use.

apply_image.py

Create a printable rasterized image that can be hole punched and animated.

usage: apply_image.py [-h] name destination template ...

positional arguments:
  name         Name of project
  destination  File to output image to
  template     Template file to use
  images       Images to place as cells