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
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
uint32_t format
Video format.
Definition: video_device.h:61
Definition: image.h:80
float focal_x
focal length in the x-direction in pixels
Definition: video_device.h:47
struct crop_t crop
Cropped area definition.
Definition: video_device.h:58
struct img_size_t output_size
Output image size.
Definition: video_device.h:56
char * dev_name
path to device
Definition: video_device.h:59
uint8_t filters
filters to use (bitfield with VIDEO_FILTER_x)
Definition: video_device.h:64
struct video_config_t dummy_camera
uint8_t buf_cnt
Amount of V4L2 video device buffers.
Definition: video_device.h:63
struct video_listener * cv_listener
The first computer vision listener in the linked list for this video device.
Definition: video_device.h:66
Image helper functions like resizing, color filter, converters...
struct img_size_t sensor_size
Original sensor size.
Definition: video_device.h:57
unsigned long uint32_t
Definition: types.h:18
char * subdev_name
path to sub device
Definition: video_device.h:60
float Dhane_k
(un)distortion parameter for a fish-eye lens
Definition: video_device.h:51
int fps
Target FPS.
Definition: video_device.h:67
unsigned char uint8_t
Definition: types.h:14
float focal_y
focal length in the y-direction in pixels
Definition: video_device.h:48
volatile bool is_running
When the device is running.
Definition: video_device.h:39
float center_y
center image coordinate in the y-direction
Definition: video_device.h:50
struct camera_intrinsics_t camera_intrinsics
Intrinsics of the camera; camera calibration parameters and distortion parameter(s) ...
Definition: video_device.h:68
struct v4l2_device * dev
The V4L2 device that is used for the video stream.
Definition: video_device.h:40
uint32_t subdev_format
Subdevice video format.
Definition: video_device.h:62
V4L2 device settings.
Definition: video_device.h:55
struct video_thread_t thread
Information about the thread this camera is running on.
Definition: video_device.h:65
float center_x
center image coordinate in the x-direction
Definition: video_device.h:49