See this link for an introduction on time stacking and time slicing.
time_slice.R
requires the number of pixels wide or tall the image is to be a multiple of the number of images in your timelapse.
time_slice_v2.R
attempts to get around this. Some images will contribute more pixels per slice than others. This is done by making the first x%
of the images cover the first x%
of the pixels (with appropriate rounding). It does not deal with number of images being greater than the height or width of the images in pixels. Version 2 will probably work better for you.
For example, if the images are 150 pixels wide and your timelapse has 100 images, time_slice.R
will make the first image have a slice which is 51 pixels wide. The remaining 99 images will get slices which are 1 pixel wide. time_slice_v2.R
will alternate between 1 pixel per image and 2 pixels per image. All of the odd numbered images will get 1 pixel and all of the even numbered images will get 2 pixels. I haven't tested it out enough to tell if this causes any weird undesired (or desired) effects.
time_slice_lapse.R
creates a time lapse out of time slices. (It actually creates the images necessary to create a time lapse. You still have to combine them into a movie.)
There are five options. As before, you can choose the direction
. Then I split the path into source_path
and save_path
. The source_path
is where the original images are saved. The save_path
is where you want to save the time_slices, which will be used to create a time lapse.
The two new options are images_per_slice
and num_of_slices
. images_per_slice
controls how many images make up each slice and num_of_slices
controls how many slices will be in the time lapse. You probably want to use the default for the num_of_slices
(i.e. use all of the available images). For images_per_slice
, you can probably get different results based on this. The larger this is, the more time passes with a slice, but the fewer available slices for a time lapse. images_per_slice must be less than the number of pixels wide or tall.
I tried it out on a small example and it seems to work. I used only 10 images_per_slice
which resulted in 36 total slices. It is posted here.
The code I have written is licensed MIT. Copyright Andrew Landgraf.
Sometimes while using time_slice_v2.R I get:
Error in newimg[vert, horiz, ] : subscript out of bounds
Execution halted
and some other times:
Error in newimg[vert, horiz, ] : incorrect number of dimensions
Even if I'm using images of equal size, certain folder of images will work and others won't.
What could it be? I noticed that if I remove some images, sometimes it accomplishes to create the time slice, but none of the files seem corrupt or any different from the others.
Thank you.