82 int overlap_intervals(
int val_low_1,
int val_high_1,
int val_low_2,
int val_high_2);
83 int intersection_boxes(
int x_box_1[4],
int y_box_1[4],
int x_box_2[4],
int y_box_2[4]);
Computer vision framework for onboard processing.
struct gate_img best_gate
struct gate_img gates_c[MAX_GATES]
Paparazzi generic algebra macros.
Paparazzi floating point algebra.
int check_color_snake_gate_detection(struct image_t *im, int x, int y)
int overlap_intervals(int val_low_1, int val_high_1, int val_low_2, int val_high_2)
void draw_gate_color_polygon(struct image_t *im, struct gate_img gate, uint8_t *color)
Draw the gate on an image, using the corner points, possibly resulting in a polygon.
int intersection_boxes(int x_box_1[4], int y_box_1[4], int x_box_2[4], int y_box_2[4])
void gate_refine_corners(struct image_t *color_image, int *x_points, int *y_points, int size)
Refine the four corners of the gate, based on the color around the supposed corner locations.
int sz
Half the image size of the gate.
void check_line(struct image_t *im, struct point_t Q1, struct point_t Q2, int *n_points, int *n_colored_points)
Checks whether points on a line between two 2D-points are of a given color.
int snake_gate_detection(struct image_t *img, int n_samples, int min_px_size, float min_gate_quality, float gate_thickness, int min_n_sides, uint8_t color_Ym, uint8_t color_YM, uint8_t color_Um, uint8_t color_UM, uint8_t color_Vm, uint8_t color_VM, struct gate_img *best_gate, struct gate_img *gates_c, int *n_gates, int exclude_top, int exclude_bottom)
Run snake gate detection on an image.
void check_gate_initial(struct image_t *im, struct gate_img gate, float *quality, int *sides)
Check the outline and the center of the gate.
int n_sides
How many sides are orange (to prevent detecting a small gate in the corner of a big one partially out...
float sz_left
Half the image size of the left side.
int x
The image x coordinate of the gate center.
float sz_right
Half the image size of the right side.
int y
The image y coordinate of the gate center.
int x_corners[4]
Array of corner x coordinates.
void draw_gate_color_square(struct image_t *im, struct gate_img gate, uint8_t *color)
Draw the gate on an image, using only the center coordinate and sizes - resulting in a square gate.
int y_corners[4]
Array of corner y coordinates.
void snake_up_and_down(struct image_t *im, int x, int y, int *x_low, int *y_low, int *x_high, int *y_high)
The actual snaking.
void check_gate_outline(struct image_t *im, struct gate_img gate, float *quality, int *n_sides)
Check only the outline of the gate.
float quality
gate quality
float check_inside(struct image_t *im, int x, int y, int sz, int n_samples_in)
void set_gate_points(struct gate_img *gate)
Determine and set the corner locations in gate.x_corners, g.y_corners, based on the center of the gat...
float intersection_over_union(int x_box_1[4], int y_box_1[4], int x_box_2[4], int y_box_2[4])
void snake_left_and_right(struct image_t *im, int x, int y, int *x_low, int *y_low, int *x_high, int *y_high)
The actual snaking.
void refine_single_corner(struct image_t *im, int *corner_x, int *corner_y, int size, float size_factor)
Refine a single corner, based on the color around the coordinate.
void draw_gate(struct image_t *im, struct gate_img gate)
Draw the gate on an image.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.