I wrote this script for extracting trajectories and morphological parameters from videos of tadpoles swimming in small arenas. This script use Bemovi (http://bemovi.info/), an open-source and cross-platform R package for quantifying locomotion behavior. The main objective of Bemovi is to differentiate and count protists in mixed morpho-species samples. This package basically track moving particles (i.e. the protists) on videos and extracts X- and Y-positions as well as morphological parameters (length, width). This parameters are then analysed using deep learning methods for recognizing species and counting them. In this method we took profits of the trajectories and morphological parameters extraction for testing changes due to the pesticide exposure. Bemovi’s setting is not trivial. Indeed, for allowing for multi-tracking, Bemovi has to be finely set for detecting each individuals in a video as one and only one individual. In the present script, for freeing ourselves from these constraints we cropped videos in six 490x490 pixels squares, each containing one and only one individual in the petri dish.
This script was written and tested on Fedora using R, R-Studio and Bemovi for the extraction, and FFMPEG for video convertion and 490x490 cropping.