Kiri and Steve.co.uk

line

Penhurst Retreat Centre Orchard – 2018

In 2017, we wrote a small python script for a RaspberryPi that would take a photo every 15 minutes in the daytime (calculated based on the python astral library) using an attached webcam and add a watermark and upload the picture to the web. Then, once a month in the hours of darkness, the code would generate a video timelapse (averaging the white balance of each picture) and upload that to the web. In 2018, we set up a raspberry pi and webcam in the orchard at Penhurst Retreat Centre and set it going… with limited success! The above is one of the resulting videos where the whole month worked!

We’d mounted the webcam inside a security light casing, with the raspberry pi tucked away inside the art room in the orchard… but it had limited wifi signal to the main retreat centre (despite repeaters)… and the retreat centre itself had pretty flakey internet connection. Therefore the uploading had connection checks built in. The code is basically an infinite loop… so to avoid running out of memory, I used crontab to restart the pi every few days and systemd to load up the python script on startup. However…

As part of the creation of the video, the code iterates through all of the images to be combined into the timelapse, getting the mean r,g,b values. It then calculates a mean of all of those mean values, which gives a rough approximation of white balance for the whole video… then for each image works out what the delta of r,g,b values is from the mean of the means… then opens each image in turn and for every pixel in the image tweaks the r,g,b values by the delta. Which is incredibly expensive computationally, but I guessed a raspberry pi 3 model B could get through that during the hours of darkness when it wasn’t taking pictures. Turns out maybe not in the summer months! I mean, the resulting timelapses don’t have white balance flickering, but it probably was overkill.

Code for the project can be found at on GitHub


See other creative items relating to photography / film, timelapse