Author's blog is here
VideoF2B is an open-source desktop application for tracing F2B Control Line Stunt competition flight figures in video.
Use this application to trace the path of a control line aircraft as it performs aerobatic maneuvers in F2B competition and compare it to regulation figures.
Authors: Alberto Solera, Andrey Vasilik
Online documentation is here.
-
Detects the movement of the aircraft and draw the trace of its centroid in video.
-
Draws an augmented-reality (AR) hemisphere that represents the flight envelope.
-
Displays template figures on the surface of the AR sphere according to Paragraph F2B.13 - "Description of Manoeuvres" of the FAI Sporting Code (Edition 2026). Manoeuvre diagrams are available in Annex 4J (Edition 2026) The latest versions of these regulations are available at the FAI Sporting Code page under Section 4 (Aeromodelling).
-
Allows the user to rotate and translate the AR sphere during video processing.
-
Includes a utility to perform camera calibration. This enables display of the AR sphere in videos.
-
Includes a utility to estimate the best camera placement in the field.
-
Process live video in real time.
-
Project the detected points into the virtual sphere in engineering units to track the aircraft in 3D.
-
Perform the best possible fit of executed figures to the nominal figures.
-
Determine a score per figure.
-
Create a virtual environment.
-
Clone the project from this repository and
cdinto the root directory. -
Run
pip install -e .in the virtual environment. This installs the required packages for development work, testing, and building of releases.
- Build OpenCV 5.0.0 (matches the Windows
opencv-python==5.0.0.93pin) for the virtual environment based on the instructions here — the guide predates OpenCV 5, but the same steps apply; just clone the5.0.0tag — with these changes:- Add
-D WITH_QT=OFF -D WITH_GTK=ONto thecmakecommand (and installlibgtk-3-dev). OpenCV's own bundled Qt plugins otherwise conflict with PySide6's at runtime. - On newer Ubuntu releases (26.04+),
libatlas-base-devis no longer packaged; uselibopenblas-dev liblapack-devinstead. - Point
-D PYTHON3_EXECUTABLEand-D PYTHON3_PACKAGES_PATHat your virtual environment'spythonandsite-packagesso the builtcv2module installs directly into it.
- Add
- Do not substitute the
opencv-pythonpip wheel on Linux, even though it's tempting to skip the build. Its bundled static FFmpeg registers theh264_v4l2m2mhardware encoder (meant for ARM SBCs like Raspberry Pi) ahead of softwarelibx264, socv2.VideoWriterwith the app'sH264fourcc fails outright on any machine without that hardware (VIDEOIO/FFMPEG: Failed to initialize VideoWriter) — video export is broken, even though calibration and playback look fine. Building from source links the system's real FFmpeg and doesn't hit this.
-
IMPORTANT: Create a clean virtual environment. Do not update
setuptoolsin it. Verify thatsetuptoolsversion is56.0.0viapip show setuptools. (This applies to the legacy Python 3.8/3.9 toolchain; a modernized stack on Python 3.14 has been verified to build correctly with setuptools 84.0.0 instead.) -
Install
python3-tkandlibxcb-cursor0(Linux) before building. PyInstaller's splash screen requirestkinterto be importable in the build environment's Python, and the frozen app needslibxcb-cursor.so.0at runtime for Qt'sxcbplatform plugin. Without these,build_exefails or the resulting binary won't run on a machine that lacks them. -
Tag the latest stable commit in
masterwith the desired version using a scheme that complies with PEP 440. -
Switch to the project's root directory.
-
Enter (activate) the project's virtual environment. This must be a real shell activation (e.g.
source .venv/bin/activate), not just invoking.venv/bin/pythondirectly —build_exeshells out to thepyinstallercommand by name, which is only found if the venv'sbindirectory is onPATH. -
Run the following commands:
pip install -e .
python setup.py build_exe-
The first command installs the latest version of the project locally and updates the version file
videof2b/version.pyaccording to the state of the project's current Git tree. The second command invokes PyInstaller and builds a binary end-user executable in thedistdirectory. -
Test the executable on target platforms.
-
Publish the release to the world.
-
Switch to the project's root directory.
-
Enter the project's virtual environment.
-
Run
pip install -e .[docs]. This installs the latest version of the project and thedocsextras locally. -
Switch to the
docsdirectory. -
Run
make htmlormake latex(make.bat ...on Windows) according to your target needs. The typical target ishtml. The resulting pages will be in thedocs/builddirectory. -
After making changes to documentation as needed, run
make <target>to verify the results locally. If necessary during development, runmake cleanto wipe the generated documentation files. -
This project's documentation is hosted on Read the Docs. When ready to publish, just push the changes to the main remote Git repository. Every push to the main repository triggers a new build of documentation on RTD. The build typically takes just a few minutes. Verify that the documentation build passes (see the "docs" badge at the top of this README). Verify that the online documentation reflects your changes.
See setup.cfg.
IMPORTANT: at this time the imutils package used for development is a modified fork of the official package.