Paparazzi UAS  v5.14.0_stable-0-g3f680d1
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
size_divergence.c File Reference

Calculate divergence from flow vectors by looking at line sizes between the points. More...

#include "size_divergence.h"
#include <stdlib.h>
#include "math/pprz_stat.h"
+ Include dependency graph for size_divergence.c:

Go to the source code of this file.

Macros

#define NO_DIV   0.0
 

Functions

float get_size_divergence (struct flow_t *vectors, int count, int n_samples)
 Get divergence from optical flow vectors based on line sizes between corners. More...
 

Detailed Description

Calculate divergence from flow vectors by looking at line sizes between the points.

Uses optical flow vectors as determined with a corner tracker and Lucas Kanade to estimate divergence.

Definition in file size_divergence.c.

Macro Definition Documentation

#define NO_DIV   0.0

Definition at line 37 of file size_divergence.c.

Referenced by get_size_divergence().

Function Documentation

float get_size_divergence ( struct flow_t vectors,
int  count,
int  n_samples 
)

Get divergence from optical flow vectors based on line sizes between corners.

Parameters
[in]vectorsThe optical flow vectors
[in]countThe number of optical flow vectors
[in]n_samplesThe number of line segments that will be taken into account. 0 means all line segments will be considered.
Returns
divergence

Definition at line 46 of file size_divergence.c.

References point_t::count, E, flow_t::flow_x, flow_t::flow_y, mean_f(), n_samples, NO_DIV, flow_t::pos, point_t::x, and point_t::y.

Referenced by calc_fast9_lukas_kanade().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: