Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
cv.h File Reference

Computer vision framework for onboard processing. More...

#include <pthread.h>
#include "std.h"
#include "peripherals/video_device.h"
#include <BOARD_CONFIG>
+ Include dependency graph for cv.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  cv_async
 
struct  video_listener
 

Typedefs

typedef struct image_t *(* cv_function) (struct image_t *img, uint8_t camera_id)
 

Functions

bool add_video_device (struct video_config_t *device)
 Keep track of video devices added by modules. More...
 
struct video_listenercv_add_to_device (struct video_config_t *device, cv_function func, uint16_t fps, uint8_t id)
 
struct video_listenercv_add_to_device_async (struct video_config_t *device, cv_function func, int nice_level, uint16_t fps, uint8_t id)
 
void cv_run_device (struct video_config_t *device, struct image_t *img)
 

Detailed Description

Computer vision framework for onboard processing.

Definition in file cv.h.


Data Structure Documentation

◆ cv_async

struct cv_async

Definition at line 41 of file cv.h.

+ Collaboration diagram for cv_async:
Data Fields
pthread_cond_t img_available
struct image_t img_copy
pthread_mutex_t img_mutex
volatile bool img_processed
pthread_t thread_id
volatile int thread_priority
volatile bool thread_running

◆ video_listener

struct video_listener

Definition at line 51 of file cv.h.

+ Collaboration diagram for video_listener:
Data Fields
volatile bool active
struct cv_async * async
cv_function func
uint8_t id
uint16_t maximum_fps
struct video_listener * next
struct timeval ts

Typedef Documentation

◆ cv_function

typedef struct image_t*(* cv_function) (struct image_t *img, uint8_t camera_id)

Definition at line 1 of file cv.h.

Function Documentation

◆ add_video_device()

bool add_video_device ( struct video_config_t device)

Keep track of video devices added by modules.

Definition at line 197 of file video_thread.c.

References cameras, video_config_t::dev_name, initialize_camera(), printf_debug, and VIDEO_THREAD_MAX_CAMERAS.

Referenced by cv_add_to_device().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cv_add_to_device()

◆ cv_add_to_device_async()

struct video_listener* cv_add_to_device_async ( struct video_config_t device,
cv_function  func,
int  nice_level,
uint16_t  fps,
uint8_t  id 
)

Definition at line 83 of file cv.c.

References video_listener::async, image_t::buf, image_t::buf_size, cv_add_to_device(), cv_async_thread(), video_listener::func, cv_async::img_available, cv_async::img_copy, cv_async::img_mutex, listener, cv_async::thread_id, and cv_async::thread_priority.

Referenced by bebop_ae_awb_init(), and viewvideo_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cv_run_device()

void cv_run_device ( struct video_config_t device,
struct image_t img 
)

Definition at line 178 of file cv.c.

References video_listener::active, video_listener::async, cv_async_function(), video_config_t::cv_listener, video_listener::func, video_listener::id, listener, video_listener::maximum_fps, video_listener::next, timeval_diff(), video_listener::ts, and image_t::ts.

Referenced by video_thread_function().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: