Tools to process photos and videos of projected slides.
- Ensure Python is installed and up to date (tested using Python 3.11).
- Install dependencies with
pip install -r requirements.txt
.
Turn a video recording of a slide projector flipping through slides into a directory of photos.
- Start the script with
python src/process_video.py <INPUT_PATH>
which will use default parameters. - Drag the red circles into the corners of the slide. Press enter when finished.
- The image displayed is an average of all photos loaded so far.
- Wait for the script to transform all images.
- View the results in the specified output directory (defaults to
./output
). - View the brightness graph in the specified output path (defaults to
./brightness.png
)- If not all slides are captured, or duplicate slides are captured, reference the brightness graph and tweak the priming and capture brightness using the flags below.
- The priming brightness should be just below the shortest peak.
- The capture brightness should be just above the shallowest dip.
Name | Flag | Default | Description |
---|---|---|---|
Output | -o |
./output |
The output path. The directory will be created if it does not exist. |
Aspect Ratio | -a |
3:2 |
The aspect ratio of the resulting images. This depends on the type of slides you are scanning. |
Priming Brightness | -p |
75 |
How bright the frame needs to be before priming. Too low and you may capture duplicates, too high and you may miss slides. |
Capture Brightness | -c |
10 |
How dim the frame needs to be before capturing. Too low and you may miss slides, too high and you may capture before the exposure has fully adjusted. |
Backtrack Time | -b |
50 |
How many milliseconds to backtrack when capturing. Too low and you may capture slide transitions, too high and you may capture before the exposure has fully adjusted. |
Start Frame | -s |
0 |
The frame number processing starts at. |
End Frame | -e |
None (no limit) |
The frame number processing ends at. |
Corners | -n |
None (prompt) |
A JSON array of the starting positions of each corner. Useful if the camera and projector have not moved between runs, or if you want to keep the corners constant while tweaking other values. |
Scale Down | -d |
2 |
The factor to scale down pygame window sizes by. If the pygame window extends beyond the edges of your screen, consider increasing this factor. |
Transform and rotate a directory of photos of a slide projector screen.
- Start the script with
python src/process_photos.py -t -r <INPUT_PATH>
which will use default parameters and perform both transforms and rotations. - Drag the red circles into the corners of the slide. Press enter when finished.
- The image displayed is an average of all photos loaded so far.
- Wait for the script to transform all images.
- Rotate images using the arrow keys, press the corresponding number keys to choose a slide to save and advance or backspace to go back one slide.
- If "Images Per Slide" is 1, the "1" number key will be the only option to advance.
- The window will automatically close once its gone through all slides.
- Wait for the script to rotate all images.
- View the results in the specified output directory (defaults to
./output
).
Name | Flag | Default | Description |
---|---|---|---|
Output | -o |
./output |
The output path. The directory will be created if it does not exist. |
Aspect Ratio | -a |
3:2 |
The aspect ratio of the resulting images. This depends on the type of slides you are scanning. |
Corners | -n |
None |
A JSON array of the starting positions of each corner. Useful if the camera and projector have not moved between runs. |
Images Per Slide | -i |
1 |
How many images in the input folder represent one slide. This is useful if your camera saves multiple photos per slide. Only the latest image will be saved. |
Transform | -t |
off |
Perform an initial pass using the corners to transform each image to account for rotation and skew. |
Rotate | -r |
off |
Perform a second pass using the arrow keys to optionally rotate each image. |
Scale Down | -d |
2 |
The factor to scale down pygame window sizes by. If the pygame window extends beyond the edges of your screen, consider increasing this factor. |
Year | -y |
None |
Changes the dates on all photos to the set year. Each photo will be set to one minute after the previous. |
Rotate and select photos during capture so it doesn't have to be done as a second pass.
- Start the script with
python src/live_selection.py <INPUT_PATH>
which will use default parameters. - Take pictures that write to the specified input path. Alternatively for testing you can use
python src/simulate_iad.py <INPUT_PATH>
to generate test images. - Rotate images using the arrow keys, press the corresponding number keys to choose a slide to save or escape to discard the current images.
- If "Images Per Slide" is 1, the "1" number key will be the only option to continue.
- Repeat from step 2 until the tray is scanned, then use CTRL+C to stop the script.
- View the results in the specified output directory (defaults to
./output
).
Name | Flag | Default | Description |
---|---|---|---|
Output | -o |
./output |
The output path. The directory will be created if it does not exist. |
Images Per Slide | -i |
1 |
How many images in the input folder represent one slide. This is useful if your camera saves multiple photos per slide. Only the latest image will be saved. |
Scale Down | -d |
2 |
The factor to scale down pygame window sizes by. If the pygame window extends beyond the edges of your screen, consider increasing this factor. |