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:
When you start working with Python it is great practice to create isolated Python environments to work on your specific projects.
The standard python environment is used by a large number of system scripts and therefore best to leave alone. In addition, when working on different projects, those projects may have different and conflicting dependencies and therefore should ideally be installed in their own python environments. The ability to create different python environments can also be really beneficial when developing your own python packages and thereby test its installation and performance in different versions of python.
Below I guide you through the basic steps of installing and working with python virtual environments.
Installing OpenCV has never been easy and always required a lot of careful usage of the command line to build from source. This was especially painful when working with a Raspberry Pi as building and installing OpenCV took a lot of time on the RPi, especially on the older models. Luckily this has changed very recently as it is now possible to install OpenCV with pip!
Below I guide you through the basic steps that I think are necessary to get opencv to work nicely on Mac, Ubuntu and Raspberry Pi. If you want more background information, see the excellent article by Adrian Rosebrock from PyImageSearch.com.
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 :)
It works pretty well already, even with non-optimal videos. Next step will be to stitch the videos of multiple linked camera’s.