Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
video_device.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015
3  *
4  * This file is part of Paparazzi.
5  *
6  * Paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * Paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, see
18  * <http://www.gnu.org/licenses/>.
19  *
20  */
21 
26 #ifndef VIDEO_DEVICE_H
27 #define VIDEO_DEVICE_H
28 
29 #include <stdbool.h>
30 #include <inttypes.h>
32 
33 /* Different video filters */
34 #define VIDEO_FILTER_DEBAYER (0x1 << 0)
35 #define VIDEO_FILTER_ISP (0x1 << 1)
36 
37 // Main video_thread structure
39  volatile bool is_running;
40  struct v4l2_device *dev;
41 };
42 
43 // camera intrinsics: capture lens properties that determine how world points are projected to image points
44 // These properties can be obtained with a camera calibration (as done in openCV)
45 // The Dhane (un)distortion parameter is normally tuned by hand, for example with the undistortion module in Paparazzi
47  float focal_x;
48  float focal_y;
49  float center_x;
50  float center_y;
51  float Dhane_k;
52 };
53 
58  struct crop_t crop;
59  char *dev_name;
60  char *subdev_name;
67  int fps;
70 };
71 extern struct video_config_t dummy_camera;
72 
73 #endif
video_config_t::thread
struct video_thread_t thread
Information about the thread this camera is running on.
Definition: video_device.h:65
video_config_t::output_size
struct img_size_t output_size
Output image size.
Definition: video_device.h:56
video_config_t::filters
uint8_t filters
filters to use (bitfield with VIDEO_FILTER_x)
Definition: video_device.h:64
uint32_t
unsigned long uint32_t
Definition: types.h:18
video_config_t::dev_name
char * dev_name
path to device
Definition: video_device.h:59
video_config_t::cv_listener
struct video_listener * cv_listener
The first computer vision listener in the linked list for this video device.
Definition: video_device.h:66
crop_t
Definition: image.h:92
video_thread_t
Definition: video_device.h:38
dummy_camera
struct video_config_t dummy_camera
video_config_t::buf_cnt
uint8_t buf_cnt
Amount of V4L2 video device buffers.
Definition: video_device.h:63
video_config_t::subdev_name
char * subdev_name
path to sub device
Definition: video_device.h:60
camera_intrinsics_t::Dhane_k
float Dhane_k
(un)distortion parameter for a fish-eye lens
Definition: video_device.h:51
uint8_t
unsigned char uint8_t
Definition: types.h:14
image.h
video_config_t::fps
int fps
Target FPS.
Definition: video_device.h:67
camera_intrinsics_t::focal_y
float focal_y
focal length in the y-direction in pixels
Definition: video_device.h:48
video_config_t::sensor_size
struct img_size_t sensor_size
Original sensor size.
Definition: video_device.h:57
img_size_t
Definition: image.h:86
video_config_t::camera_intrinsics
struct camera_intrinsics_t camera_intrinsics
Intrinsics of the camera; camera calibration parameters and distortion parameter(s)
Definition: video_device.h:68
video_thread_t::dev
struct v4l2_device * dev
The V4L2 device that is used for the video stream.
Definition: video_device.h:40
camera_intrinsics_t::center_y
float center_y
center image coordinate in the y-direction
Definition: video_device.h:50
video_listener
Definition: cv.h:51
video_config_t::subdev_format
uint32_t subdev_format
Subdevice video format.
Definition: video_device.h:62
video_thread_t::is_running
volatile bool is_running
When the device is running.
Definition: video_device.h:39
video_config_t::crop
struct crop_t crop
Cropped area definition.
Definition: video_device.h:58
inttypes.h
camera_intrinsics_t::center_x
float center_x
center image coordinate in the x-direction
Definition: video_device.h:49
v4l2_device
Definition: v4l2.h:50
camera_intrinsics_t::focal_x
float focal_x
focal length in the x-direction in pixels
Definition: video_device.h:47
camera_intrinsics_t
Definition: video_device.h:46
video_config_t::format
uint32_t format
Video format.
Definition: video_device.h:61
video_config_t
V4L2 device settings.
Definition: video_device.h:55