Code to take part of a movie, identify the moving parts, and simulate a multiple exposure image. Useful for teaching kinematics and having students calculate the motion of things from a static image.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
LICENSE
README.md
add_multiple_files.py
add_two_images.py
dump_frames_from_movie.sh
img0.jpg
img1.png
rip_out_images_from_movie.py
run_add_multiple_files.sh
take_a_move_and_slice_it_up.ipynb
test_webcam.py
test_your_opencv_installation.py
time_slice_tools.py

README.md

time-slices

Code to take part of a movie, identify the moving parts, and simulate a multiple exposure image. Useful for teaching kinematics and having students calculate the motion of things from a static image.

Getting started

You need

  • opencv (for the image manipulation)
  • ffmpeg (for now, to pull individual frames out of the movie. maybe there's something more general we can use?)

Install opencv and the python module on your system.

This can be...challenging.

Test your system

Read in and display two images using the opencv python library.

python test_your_opencv_installation.py

"Add" two images.

python add_two_images.py

Mock-up a multiple-exposure image!

To try this out, download the running.mp4 (THIS WILL SOON BE A REAL LINK) example that I ripped from YouTube.

Run the following shell script which uses ffmpeg to pull out some images from the movie.

sh dump_frames_from_movie.sh

Then run this shell script which calls a python script, add_multiple_files.sh.

sh run_add_multiple_files.sh

This should produce something that looks like a multiple exposure image, though a bit pixelated.

Production grade version!

Everything should be able to be run with the following Jupyter-notebook script

take_a_move_and_slice_it_up.ipynb