Message Boards Message Boards

GROUPS:

How to Make a Time Lapse Video With Your Raspberry Pi and Data Drop

Posted 6 years ago
25275 Views
|
8 Replies
|
30 Total Likes
|

Wolfram Pi Flowers


I will explain how to make the time-lapse animation you can see above.

1) Set-up your camera module. I sticked mine on a hard drive, see the first image on my previous Data Drop post.

setup

2) Take a test shot to check that the exposure is acceptable.

DeviceRead["RaspiCam",{320, 240}]

3) Adjust the resulting image with ImageAdjust.

ImageAdjust[DeviceRead["RaspiCam",{320, 240}]]

Test shot

4) Create a new databin, and take note of its short ID:

CloudConnect["email-wolframID","password" ];
bin=CreateDatabin[];
bin["ShortID"]

"3GgU-jf4"

5) Setup a ScheduledTask that adds a snapshot to your databin every 360 seconds (6minutes):

intervalometer=RunScheduledTask[DatabinAdd[Databin["3GgU-jf4"], ImageAdjust[DeviceRead["RaspiCam",{320, 240}]]],360]

6) Water your plant and wait.

7) Check that your databin is being filled correctly http://wolfr.am/3GgU-jf4

databin

8) Compile the animated gif:

frames = Values[Databin["3GgU-jf4"]]; 
Export["resurrected_plant.gif", Join[frames, Reverse[frames]]]

9) Enjoy!

Wolfram Pi Flowers

10) To stop your scheduled task, use the function StopScheduledTask:

StopScheduledTask[intervalometer]
8 Replies
Posted 6 years ago

Very cool! Thanks for sharing.

Excellent application! Thanks for sharing!

This is great. Can't wait to try this with my kids. Thanks for the idea and HOWTO.

Posted 6 years ago

Thanks for sharing.
I have tried your post successively from step 1 to 8.
Step 9 is a smooth animation of flower pictures.
I have tried to animate it using Manipulate and to export it as embedded CDF. Here is my trial web page in Japanese. http://mmays.hatenablog.com/entry/2015/02/20/183838

My script uses a public folder of Dropbox.

<script type="text/javascript" src="http://www.wolfram.com/cdf-player/plugin/v2.1/cdfplugin.js"></script>
<script type="text/javascript">
var cdf = new cdfplugin();
cdf.setDefaultContent('<a href="http://www.wolfram.com/cdf-player/"><img  src="https://dl.dropboxusercontent.com/u/101591086/cdf-manip/Manipulate-web.png"></a>');
cdf.embed('https://dl.dropboxusercontent.com/u/101591086/cdf-manip/Manipulate-web.cdf', 391, 367);
</script>

Pictures do not move smoothly. Woud you give me a suggestion to improve my program ?

Yoshihiro Sato

Attachment

Hi Yoshihiro, I would suggest you to play the animation "Faster" ? and add more pictures between displacements. These options might be also useful to improve your CDF animations:

AnimationRate -> 1, AnimationDirection -> ForwardBackward, 
DefaultDuration -> "(total number of frames)/(desired number of frames per second)"
Posted 6 years ago

After reading the post, Showcasing Manipulate[…] via .GIF animations, I understand your suggestion.
Thank you.
Yoshihiro Sato

Hey Bernat, I tried to follow you tutorial but an error is showing, enter image description here ~Get::noopen: Cannot open /home/pi/.Mathematica/Paclets/Repository/Interpreter-1.3.140.0/Kernel/32Bit/Interpreter.mx.~

Do you know how to solve it?

- I'm using Raspberry 3b+ with Wolfram 12.1 installed. -

Thanks.

Posted 7 months ago

Wow, what a brainy way to create an animated gif that also looks like a stop motion.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract