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]);
void draw_gate(struct image_t *im, struct gate_img gate)
Draw the gate on an image.
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.
struct gate_img best_gate
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 check_gate_outline(struct image_t *im, struct gate_img gate, float *quality, int *n_sides)
Check only the outline of the gate.
struct gate_img gates_c[MAX_GATES]
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 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...
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.
float sz_right
Half the image size of the right side.
int overlap_intervals(int val_low_1, int val_high_1, int val_low_2, int val_high_2)
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...
Paparazzi floating point algebra.
int n_sides
How many sides are orange (to prevent detecting a small gate in the corner of a big one partially out...
Paparazzi generic algebra macros.
Computer vision framework for onboard processing.
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.
float intersection_over_union(int x_box_1[4], int y_box_1[4], int x_box_2[4], int y_box_2[4])
int y
The image y coordinate of the gate center.
float quality
gate quality
int intersection_boxes(int x_box_1[4], int y_box_1[4], int x_box_2[4], int y_box_2[4])
int x
The image x coordinate of the gate center.
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...
int check_color_snake_gate_detection(struct image_t *im, int x, int y)
int x_corners[4]
Array of corner x coordinates.
float sz_left
Half the image size of the left side.
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 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.
int y_corners[4]
Array of corner y coordinates.
int sz
Half the image size of the gate.
float check_inside(struct image_t *im, int x, int y, int sz, int n_samples_in)