Difference between revisions of "Optical flow"

From PaparazziUAV
Jump to navigation Jump to search
m (Pietro moved page Module:Optical flow to Optical flow over redirect)
Line 1: Line 1:
Optical flow module
The optical flow module in Paparazzi allows for the extraction of flow information from a video thread. This is particularly useful to extrapolate the velocity of the vehicle with respect to the ground or the environment.
 
=Pipeline Overview=
 
The optical flow pipeline can be summarized as follows:
 
* The '''opticflow_module.c''' script looks at up to two different video threads
* The '''opticflow_calculator.c''' script runs a set of pre-selectable algorithms to extract the flow messages
* The '''opticflow_module.c''' script publishes the ABI message '''OPTICAL_FLOW''' for later processing
 
=Usage=
 
The opticalflow module requires a correct tuning of parameters in order to perform efficiently in terms of execution speed and accuracy.
 
Here a set of advice is reported for a pipeline operating with:
 
* ACT_FAST algorithm for corner detection
* LUKAS_KANADE algorithm for feature tracking
 
For proper operation, keep in mind that:
 
* ask for frames that you will use: if your camera sends more FPS than what the OPTICFLOW_FPS parameter specifies, the pipeline slows down. Tune both the FPS of the camera driver and the FPS of the module accordingly.
* find the sweet spot between resolution and execution time: the LUKAS_KANADE algorithm requires convolution over the images to execute; this means that the speed of the process is affected by the resolution of the convoluted image. It is therefore not useful to run with high resolution images if lower resolution ones provide a good result as well.
* (for Lukas Kanade setting only) choose the right pyramid level setting:

Revision as of 08:44, 15 February 2022

The optical flow module in Paparazzi allows for the extraction of flow information from a video thread. This is particularly useful to extrapolate the velocity of the vehicle with respect to the ground or the environment.

Pipeline Overview

The optical flow pipeline can be summarized as follows:

  • The opticflow_module.c script looks at up to two different video threads
  • The opticflow_calculator.c script runs a set of pre-selectable algorithms to extract the flow messages
  • The opticflow_module.c script publishes the ABI message OPTICAL_FLOW for later processing

Usage

The opticalflow module requires a correct tuning of parameters in order to perform efficiently in terms of execution speed and accuracy.

Here a set of advice is reported for a pipeline operating with:

  • ACT_FAST algorithm for corner detection
  • LUKAS_KANADE algorithm for feature tracking

For proper operation, keep in mind that:

  • ask for frames that you will use: if your camera sends more FPS than what the OPTICFLOW_FPS parameter specifies, the pipeline slows down. Tune both the FPS of the camera driver and the FPS of the module accordingly.
  • find the sweet spot between resolution and execution time: the LUKAS_KANADE algorithm requires convolution over the images to execute; this means that the speed of the process is affected by the resolution of the convoluted image. It is therefore not useful to run with high resolution images if lower resolution ones provide a good result as well.
  • (for Lukas Kanade setting only) choose the right pyramid level setting: