New paper and software package: pirecorder!

Paper screenshot

My latest paper has just been published in the Journal of Open Source Software! It is the paper that accompanies my Python package pirecorder, which facilitates controlled and automated image and video recordings with optimal settings for the raspberry pi, specifically developed for biological research.

So far, researchers have often relied on writing their own recordings scripts to take still photographs and videos from the command line.

Although some specific software solutions exist, what was missing is a complete solution that helps researchers, especially those with limited coding skills, to easily set up and configure their raspberry pi to run large numbers of controlled and automated image and video recordings.

pirecorder was developed to overcome this need. You can get a quick overview of the package and what it is capable of in the video below:


Pirecorder is open source via GitHub, https://github.com/JolleJolles/pirecorder, easy to install using pip (pip install pirecorder), and comes with its own dedicated documentation website: https://jollejolles.github.io/pirecorder/.

The accompanying paper is published in the Journal of Open Source Software:

Jolles, J.W. (2020). pirecorder: controlled and automated image and video recording with the raspberry pi. Journal of Open Source Software 5(54), 2584. doi: 10.21105/joss.02584.

Learning a new skill: LaTeX

The last few weeks I delved into learning \LaTeX, a code language for more aesthetically pleasing article writing, especially in terms of mathematical formulas. As my research has increasingly been focused on the mechanisms underlying collective behaviour, for which I do a lot of mathematical computations, such an advanced yet simple text-editor is very helpful and overcomes the many pains I have with MS word!

(1)   \begin{equation*} v_i(t) = |\mathbf v_i(t)| = \sqrt{u_i^2(t)+w_i^2(t)}. \end{equation*}

(2)   \begin{equation*} \mathbf a_i(t)= \frac{\mathbf v_i(t+\Delta t) - \mathbf v_i(t)}{\Delta t} = \frac{\mathbf r_i(t+\Delta t) - \mathbf 2r_i(t)+\mathbf r_i(t-\Delta t)}{\Delta t^2}, \end{equation*}

(3)   \begin{equation*} \rho(t)=\frac{1}{n}\sqrt{\left( \sum_{i=1}^{n}\sin(\psi_i(t))\right)^2+\left( \sum_{i=1}^{n}\cos(\psi_i(t))\right)^2} \end{equation*}

It was quite a steep learning curve, but I managed to write my first paper with it last week. The great thing is that it is also possible to use \LaTeX in wordpress (which I used to create this website). It is also the standard language for drafting preprint articles, which is increasingly suggested and done in the biological sciences, thus a very relevant skill to learn.

Camera calibration and reconstruction for fish experiments

The last few months I have been working hard on the sophisticated new experimental set-ups in the lab with which we will be able to get high spatial and temporal resolution tracking of large schools of fish, in tanks that are up to 3x3m in size!

To get highly accurate spatial data of the fish we need to correct for the distortion of the camera lens, which almost all lenses have to some extent. I just finished the script (in Python) that enables us to undistort the image from a camera using functions in opencv based on a video of a moving checkerboard.

Me calibrating a camera with a checkerboard pattern, with colours showing the output of my python script, with a school of 1000 moderlieschen in the background :)

Me calibrating a camera with a checkerboard pattern, with colours showing the output of my python script, with a school of 1000 moderlieschen in the background :)

It works pretty well already, even with non-optimal videos. Next step will be to stitch the videos of multiple linked camera’s.