Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
#include "modules/computer_vision/cv_detect_color_object.h"
#include "modules/computer_vision/cv.h"
#include "subsystems/abi.h"
#include "std.h"
#include <stdio.h>
#include <stdbool.h>
#include <math.h>
#include "pthread.h"
Go to the source code of this file.
Data Structures | |
struct | color_object_t |
Macros | |
#define | PRINT(string, ...) fprintf(stderr, "[object_detector->%s()] " string,__FUNCTION__ , ##__VA_ARGS__) |
#define | VERBOSE_PRINT(...) |
#define | COLOR_OBJECT_DETECTOR_FPS1 0 |
Default FPS (zero means run at camera fps) More... | |
#define | COLOR_OBJECT_DETECTOR_FPS2 0 |
Default FPS (zero means run at camera fps) More... | |
Functions | |
uint32_t | find_object_centroid (struct image_t *img, int32_t *p_xc, int32_t *p_yc, bool draw, uint8_t lum_min, uint8_t lum_max, uint8_t cb_min, uint8_t cb_max, uint8_t cr_min, uint8_t cr_max) |
static struct image_t * | object_detector (struct image_t *img, uint8_t filter) |
struct image_t * | object_detector1 (struct image_t *img, uint8_t camera_id) |
struct image_t * | object_detector2 (struct image_t *img, uint8_t camera_id) |
void | color_object_detector_init (void) |
void | color_object_detector_periodic (void) |
Variables | |
static pthread_mutex_t | mutex |
uint8_t | cod_lum_min1 = 0 |
uint8_t | cod_lum_max1 = 0 |
uint8_t | cod_cb_min1 = 0 |
uint8_t | cod_cb_max1 = 0 |
uint8_t | cod_cr_min1 = 0 |
uint8_t | cod_cr_max1 = 0 |
uint8_t | cod_lum_min2 = 0 |
uint8_t | cod_lum_max2 = 0 |
uint8_t | cod_cb_min2 = 0 |
uint8_t | cod_cb_max2 = 0 |
uint8_t | cod_cr_min2 = 0 |
uint8_t | cod_cr_max2 = 0 |
bool | cod_draw1 = false |
bool | cod_draw2 = false |
struct color_object_t | global_filters [2] |
struct color_object_t |
Definition at line 74 of file cv_detect_color_object.c.
Data Fields | ||
---|---|---|
uint32_t | color_count | |
bool | updated | |
int32_t | x_c | |
int32_t | y_c |
#define COLOR_OBJECT_DETECTOR_FPS1 0 |
Default FPS (zero means run at camera fps)
Definition at line 49 of file cv_detect_color_object.c.
#define COLOR_OBJECT_DETECTOR_FPS2 0 |
Default FPS (zero means run at camera fps)
Definition at line 52 of file cv_detect_color_object.c.
#define PRINT | ( | string, | |
... | |||
) | fprintf(stderr, "[object_detector->%s()] " string,__FUNCTION__ , ##__VA_ARGS__) |
Definition at line 39 of file cv_detect_color_object.c.
#define VERBOSE_PRINT | ( | ... | ) |
Definition at line 43 of file cv_detect_color_object.c.
void color_object_detector_init | ( | void | ) |
Definition at line 154 of file cv_detect_color_object.c.
References cod_cb_max1, cod_cb_max2, cod_cb_min1, cod_cb_min2, cod_cr_max1, cod_cr_max2, cod_cr_min1, cod_cr_min2, cod_draw1, cod_draw2, cod_lum_max1, cod_lum_max2, cod_lum_min1, cod_lum_min2, COLOR_OBJECT_DETECTOR_FPS1, COLOR_OBJECT_DETECTOR_FPS2, cv_add_to_device(), global_filters, mutex, object_detector1(), and object_detector2().
void color_object_detector_periodic | ( | void | ) |
Definition at line 259 of file cv_detect_color_object.c.
References color_count, COLOR_OBJECT_DETECTION1_ID, COLOR_OBJECT_DETECTION2_ID, global_filters, mutex, color_object_t::updated, color_object_t::x_c, and color_object_t::y_c.
uint32_t find_object_centroid | ( | struct image_t * | img, |
int32_t * | p_xc, | ||
int32_t * | p_yc, | ||
bool | draw, | ||
uint8_t | lum_min, | ||
uint8_t | lum_max, | ||
uint8_t | cb_min, | ||
uint8_t | cb_max, | ||
uint8_t | cr_min, | ||
uint8_t | cr_max | ||
) |
Definition at line 209 of file cv_detect_color_object.c.
References image_t::buf, image_t::h, up, and image_t::w.
Referenced by object_detector().
Definition at line 94 of file cv_detect_color_object.c.
References cod_cb_max1, cod_cb_max2, cod_cb_min1, cod_cb_min2, cod_cr_max1, cod_cr_max2, cod_cr_min1, cod_cr_min2, cod_draw1, cod_draw2, cod_lum_max1, cod_lum_max2, cod_lum_min1, cod_lum_min2, color_object_t::color_count, find_object_centroid(), global_filters, image_t::h, mutex, color_object_t::updated, VERBOSE_PRINT, image_t::w, color_object_t::x_c, and color_object_t::y_c.
Referenced by object_detector1(), and object_detector2().
Definition at line 143 of file cv_detect_color_object.c.
References object_detector().
Referenced by color_object_detector_init().
Definition at line 149 of file cv_detect_color_object.c.
References object_detector().
Referenced by color_object_detector_init().
uint8_t cod_cb_max1 = 0 |
Definition at line 59 of file cv_detect_color_object.c.
Referenced by color_object_detector_init(), and object_detector().
uint8_t cod_cb_max2 = 0 |
Definition at line 66 of file cv_detect_color_object.c.
Referenced by color_object_detector_init(), and object_detector().
uint8_t cod_cb_min1 = 0 |
Definition at line 58 of file cv_detect_color_object.c.
Referenced by color_object_detector_init(), and object_detector().
uint8_t cod_cb_min2 = 0 |
Definition at line 65 of file cv_detect_color_object.c.
Referenced by color_object_detector_init(), and object_detector().
uint8_t cod_cr_max1 = 0 |
Definition at line 61 of file cv_detect_color_object.c.
Referenced by color_object_detector_init(), and object_detector().
uint8_t cod_cr_max2 = 0 |
Definition at line 68 of file cv_detect_color_object.c.
Referenced by color_object_detector_init(), and object_detector().
uint8_t cod_cr_min1 = 0 |
Definition at line 60 of file cv_detect_color_object.c.
Referenced by color_object_detector_init(), and object_detector().
uint8_t cod_cr_min2 = 0 |
Definition at line 67 of file cv_detect_color_object.c.
Referenced by color_object_detector_init(), and object_detector().
bool cod_draw1 = false |
Definition at line 70 of file cv_detect_color_object.c.
Referenced by color_object_detector_init(), and object_detector().
bool cod_draw2 = false |
Definition at line 71 of file cv_detect_color_object.c.
Referenced by color_object_detector_init(), and object_detector().
uint8_t cod_lum_max1 = 0 |
Definition at line 57 of file cv_detect_color_object.c.
Referenced by color_object_detector_init(), and object_detector().
uint8_t cod_lum_max2 = 0 |
Definition at line 64 of file cv_detect_color_object.c.
Referenced by color_object_detector_init(), and object_detector().
uint8_t cod_lum_min1 = 0 |
Definition at line 56 of file cv_detect_color_object.c.
Referenced by color_object_detector_init(), and object_detector().
uint8_t cod_lum_min2 = 0 |
Definition at line 63 of file cv_detect_color_object.c.
Referenced by color_object_detector_init(), and object_detector().
struct color_object_t global_filters[2] |
Definition at line 80 of file cv_detect_color_object.c.
Referenced by color_object_detector_init(), color_object_detector_periodic(), and object_detector().
|
static |
Definition at line 46 of file cv_detect_color_object.c.
Referenced by color_object_detector_init(), color_object_detector_periodic(), i2c_linux_submit(), i2c_thread(), and object_detector().