39 #include "generated/airframe.h"
52 #ifndef DISP_RANGE_MAX
53 #define DISP_RANGE_MAX 50
55 #ifndef MAX_WINDOW_SIZE
56 #define MAX_WINDOW_SIZE 20
58 #ifndef OPTICFLOW_FOV_W
59 #define OPTICFLOW_FOV_W 0.89360857702
61 #ifndef OPTICFLOW_FOV_H
62 #define OPTICFLOW_FOV_H 0.67020643276
uint32_t getMinimum(uint32_t *a, uint32_t n)
Calculate minimum of an array.
void calculate_edge_displacement(int32_t *edge_histogram, int32_t *edge_histogram_prev, int32_t *displacement, uint16_t size, uint8_t window, uint8_t disp_range, int32_t der_shift)
Calculate_displacement calculates the displacement between two histograms.
void draw_edgeflow_img(struct image_t *img, struct edge_flow_t edgeflow, int32_t *edge_hist_x_prev, int32_t *edge_hist_x)
Draws edgehistogram, displacement and linefit directly on the image for debugging (only for edgeflow ...
struct FloatEulers eulers
void calculate_edge_histogram(struct image_t *img, int32_t edge_histogram[], char direction, uint16_t edge_threshold)
Calculate a edge/gradient histogram for each dimension of the image.
void line_fit(int32_t *displacement, int32_t *divergence, int32_t *flow, uint32_t size, uint32_t border, uint16_t RES)
Fits a linear model to an array with pixel displacements with least squares.
struct timeval frame_time
void calc_previous_frame_nr(struct opticflow_result_t *result, struct opticflow_t *opticflow, uint8_t current_frame_nr, uint8_t *previous_frame_offset, uint8_t *previous_frame_nr)
Calc_previous_frame_nr; adaptive Time Horizon.
uint32_t timeval_diff2(struct timeval *starttime, struct timeval *finishtime)
uint32_t getAmountPeaks(int32_t *edgehist, int32_t thresh, int32_t size)
getAmountPeaks, calculates the amount of peaks in a edge histogram
Image helper functions like resizing, color filter, converters...
Inter-thread data structures.
Calculate velocity from optic flow.
struct opticflow_t opticflow[ACTIVE_CAMERAS]
Opticflow calculations.
Capture images from a V4L2 device (Video for Linux 2)
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
int int32_t
Typedef defining 32 bit int type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.