Paparazzi UAS  v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
cv_detect_color_object.c File Reference
#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"
+ Include dependency graph for cv_detect_color_object.c:

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_tobject_detector (struct image_t *img, uint8_t filter)
 
struct image_tobject_detector1 (struct image_t *img)
 
struct image_tobject_detector2 (struct image_t *img)
 
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]
 

Data Structure Documentation

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

Macro Definition Documentation

#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.

Referenced by color_object_detector_init().

#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.

Referenced by color_object_detector_init().

#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.

Referenced by object_detector().

Function Documentation

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().

+ Here is the caller graph for this function:

static struct image_t* object_detector ( struct image_t img,
uint8_t  filter 
)
static
struct image_t * object_detector1 ( struct image_t img)

Definition at line 143 of file cv_detect_color_object.c.

References object_detector().

Referenced by color_object_detector_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

struct image_t * object_detector2 ( struct image_t img)

Definition at line 149 of file cv_detect_color_object.c.

References object_detector().

Referenced by color_object_detector_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

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]