Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
lucas_kanade.h File Reference

efficient fixed-point optical-flow calculation More...

#include "std.h"
#include "image.h"
+ Include dependency graph for lucas_kanade.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define LARGE_FLOW_ERROR   1E5
 
#define MEDIUM_FLOW_ERROR   1E3
 

Functions

struct flow_topticFlowLK (struct image_t *new_img, struct image_t *old_img, struct point_t *points, uint16_t *points_cnt, uint16_t half_window_size, uint16_t subpixel_factor, uint8_t max_iterations, uint8_t step_threshold, uint8_t max_points, uint8_t pyramid_level, uint8_t keep_bad_points)
 
struct flow_topticFlowLK_flat (struct image_t *new_img, struct image_t *old_img, struct point_t *points, uint16_t *points_cnt, uint16_t half_window_size, uint16_t subpixel_factor, uint8_t max_iterations, uint8_t step_threshold, uint16_t max_points, uint8_t keep_bad_points)
 Compute the optical flow of several points using the Lucas-Kanade algorithm by Yves Bouguet The initial fixed-point implementation is doen by G. More...
 

Detailed Description

efficient fixed-point optical-flow calculation

Definition in file lucas_kanade.h.

Macro Definition Documentation

◆ LARGE_FLOW_ERROR

#define LARGE_FLOW_ERROR   1E5

Definition at line 37 of file lucas_kanade.h.

◆ MEDIUM_FLOW_ERROR

#define MEDIUM_FLOW_ERROR   1E3

Definition at line 38 of file lucas_kanade.h.

Function Documentation

◆ opticFlowLK()

struct flow_t* opticFlowLK ( struct image_t new_img,
struct image_t old_img,
struct point_t points,
uint16_t points_cnt,
uint16_t  half_window_size,
uint16_t  subpixel_factor,
uint8_t  max_iterations,
uint8_t  step_threshold,
uint8_t  max_points,
uint8_t  pyramid_level,
uint8_t  keep_bad_points 
)

◆ opticFlowLK_flat()

struct flow_t* opticFlowLK_flat ( struct image_t new_img,
struct image_t old_img,
struct point_t points,
uint16_t points_cnt,
uint16_t  half_window_size,
uint16_t  subpixel_factor,
uint8_t  max_iterations,
uint8_t  step_threshold,
uint16_t  max_points,
uint8_t  keep_bad_points 
)

Compute the optical flow of several points using the Lucas-Kanade algorithm by Yves Bouguet The initial fixed-point implementation is doen by G.

de Croon and is adapted by Freek van Tienen for the implementation in Paparazzi.

Parameters
[in]*new_imgThe newest grayscale image (TODO: fix YUV422 support)
[in]*old_imgThe old grayscale image (TODO: fix YUV422 support)
[in]*pointsPoints to start tracking from
[in/out]points_cnt The amount of points and it returns the amount of points tracked
[in]half_window_sizeHalf the window size (in both x and y direction) to search inside
[in]subpixel_factorThe subpixel factor which calculations should be based on
[in]max_iterationMaximum amount of iterations to find the new point
[in]step_thresholdThe threshold at which the iterations should stop
[in]max_pointThe maximum amount of points to track, we skip x points and then take a point.
Returns
The vectors from the original *points in subpixels

Definition at line 275 of file lucas_kanade.c.

References flow_t::error, FALSE, flow_t::flow_x, flow_t::flow_y, image_t::h, image_calculate_g(), image_create(), image_difference(), image_free(), IMAGE_GRADIENT, image_gradients(), IMAGE_GRAYSCALE, image_multiply(), image_subpixel_window(), LARGE_FLOW_ERROR, p, patch_size, flow_t::pos, TRUE, image_t::w, point_t::x, and point_t::y.

Referenced by opticFlowLK().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: