Software Metapapers
oflibnumpy & oflibpytorch: Optical Flow Handling and Manipulation in Python
Authors:
- Claudio S. RavasioEmail Claudio S. Ravasio
- Lyndon Da Cruz
- Christos Bergeles
Abstract
We present oflibnumpy and oflibpytorch, an optical flow library based on NumPy arrays and PyTorch tensors, respectively. It provides a structured approach to the representation of optical flow, i.e 2D vector fields, as a custom class offering a number of methods to apply, manipulate, analyse, and visualise the flow. The library takes into account the two possible frames of reference in optical flow calculation, namely the source (first frame) and target (second frame). The collection of methods and their rigorous mathematical underpinning makes the library broadly applicable to any project that uses flow fields. It is implemented as a Python 3 package whose source can be found on GitHub, and which can be installed either from the git repository or the Python Package Index (PyPI).
- Year: 2021
- Volume: 9 Issue: 1
- Page/Article: 31
- DOI: 10.5334/jors.380
- Submitted on 21 Jun 2021
- Accepted on 10 Nov 2021
- Published on 26 Nov 2021
- Peer Reviewed