oflibnumpy & oflibpytorch: Optical Flow Handling and Manipulation in Python

Research output: Contribution to journalArticlepeer-review


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)

Original languageEnglish
Article number31
JournalJournal of Open Research Software
Publication statusPublished - 2021


  • Optical flow
  • Flow field
  • Flow vector
  • Flow composition
  • Python
  • NumPy
  • PyTorch


Dive into the research topics of 'oflibnumpy & oflibpytorch: Optical Flow Handling and Manipulation in Python'. Together they form a unique fingerprint.

Cite this