Paparazzi UAS  v5.14.0_stable-0-g3f680d1
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
pano_unwrap.c File Reference
#include "modules/pano_unwrap/pano_unwrap.h"
#include "state.h"
#include "modules/computer_vision/cv.h"
#include <stdio.h>
+ Include dependency graph for pano_unwrap.c:

Go to the source code of this file.

Data Structures

struct  LUT_t
 

Macros

#define PANO_UNWRAP_CAMERA   bottom_camera
 
#define PANO_UNWRAP_CENTER_X   0.50
 
#define PANO_UNWRAP_CENTER_Y   0.50
 
#define PANO_UNWRAP_RADIUS_BOTTOM   0.20
 
#define PANO_UNWRAP_RADIUS_TOP   0.30
 
#define PANO_UNWRAP_FORWARD_DIRECTION   270.0
 
#define PANO_UNWRAP_FLIP_HORIZONTAL   FALSE
 
#define PANO_UNWRAP_VERTICAL_RESOLUTION   0.18
 
#define PANO_UNWRAP_DEROTATE_ATTITUDE   FALSE
 
#define PANO_UNWRAP_WIDTH   640
 
#define PANO_UNWRAP_HEIGHT   0
 
#define PANO_UNWRAP_OVERWRITE_VIDEO_THREAD   TRUE
 
#define PANO_UNWRAP_FPS   0
 
#define PIXEL_U(img, x, y)   ( ((uint8_t*)((img)->buf))[4*(int)((x)/2) + 2*(y)*(img)->w] )
 
#define PIXEL_V(img, x, y)   ( ((uint8_t*)((img)->buf))[4*(int)((x)/2) + 2*(y)*(img)->w + 2] )
 
#define PIXEL_Y(img, x, y)   ( ((uint8_t*)((img)->buf))[2*(x) + 1 + 2*(y)*(img)->w] )
 
#define RED_Y   76
 
#define RED_U   84
 
#define RED_V   255
 
#define GREEN_Y   149
 
#define GREEN_U   43
 
#define GREEN_V   21
 
#define BLUE_Y   29
 
#define BLUE_U   255
 
#define BLUE_V   107
 

Functions

static void set_output_image_size (void)
 
static void update_LUT (const struct image_t *img)
 
static void unwrap_LUT (struct image_t *img_raw, struct image_t *img)
 
static struct image_tcamera_cb (struct image_t *img)
 
void pano_unwrap_init ()
 

Variables

struct pano_unwrap_t pano_unwrap
 
struct image_t pano_unwrapped_image
 Unwrapped panoramic image. More...
 
static struct LUT_t LUT
 

Detailed Description

Author
Tom van Dijk Unwrap images taken through a panoramic lens.

Definition in file pano_unwrap.c.


Data Structure Documentation

struct LUT_t

Definition at line 115 of file pano_unwrap.c.

+ Collaboration diagram for LUT_t:
Data Fields
struct FloatVect2 * dphi
struct FloatVect2 * dtheta
struct pano_unwrap_t settings
uint16_t * x
uint16_t * y

Macro Definition Documentation

#define BLUE_U   255

Definition at line 112 of file pano_unwrap.c.

Referenced by unwrap_LUT().

#define BLUE_V   107

Definition at line 113 of file pano_unwrap.c.

Referenced by unwrap_LUT().

#define BLUE_Y   29

Definition at line 111 of file pano_unwrap.c.

Referenced by unwrap_LUT().

#define GREEN_U   43

Definition at line 109 of file pano_unwrap.c.

Referenced by unwrap_LUT().

#define GREEN_V   21

Definition at line 110 of file pano_unwrap.c.

Referenced by unwrap_LUT().

#define GREEN_Y   149

Definition at line 108 of file pano_unwrap.c.

Referenced by unwrap_LUT().

#define PANO_UNWRAP_CAMERA   bottom_camera

Definition at line 34 of file pano_unwrap.c.

Referenced by pano_unwrap_init().

#define PANO_UNWRAP_CENTER_X   0.50

Definition at line 38 of file pano_unwrap.c.

#define PANO_UNWRAP_CENTER_Y   0.50

Definition at line 41 of file pano_unwrap.c.

#define PANO_UNWRAP_DEROTATE_ATTITUDE   FALSE

Definition at line 60 of file pano_unwrap.c.

#define PANO_UNWRAP_FLIP_HORIZONTAL   FALSE

Definition at line 53 of file pano_unwrap.c.

#define PANO_UNWRAP_FORWARD_DIRECTION   270.0

Definition at line 50 of file pano_unwrap.c.

#define PANO_UNWRAP_FPS   0

Definition at line 75 of file pano_unwrap.c.

Referenced by pano_unwrap_init().

#define PANO_UNWRAP_HEIGHT   0

Definition at line 67 of file pano_unwrap.c.

#define PANO_UNWRAP_OVERWRITE_VIDEO_THREAD   TRUE

Definition at line 71 of file pano_unwrap.c.

#define PANO_UNWRAP_RADIUS_BOTTOM   0.20

Definition at line 44 of file pano_unwrap.c.

#define PANO_UNWRAP_RADIUS_TOP   0.30

Definition at line 47 of file pano_unwrap.c.

#define PANO_UNWRAP_VERTICAL_RESOLUTION   0.18

Definition at line 57 of file pano_unwrap.c.

#define PANO_UNWRAP_WIDTH   640

Definition at line 64 of file pano_unwrap.c.

#define PIXEL_U (   img,
  x,
 
)    ( ((uint8_t*)((img)->buf))[4*(int)((x)/2) + 2*(y)*(img)->w] )

Definition at line 101 of file pano_unwrap.c.

Referenced by unwrap_LUT().

#define PIXEL_V (   img,
  x,
 
)    ( ((uint8_t*)((img)->buf))[4*(int)((x)/2) + 2*(y)*(img)->w + 2] )

Definition at line 102 of file pano_unwrap.c.

Referenced by unwrap_LUT().

#define PIXEL_Y (   img,
  x,
 
)    ( ((uint8_t*)((img)->buf))[2*(x) + 1 + 2*(y)*(img)->w] )

Definition at line 103 of file pano_unwrap.c.

Referenced by unwrap_LUT().

#define RED_U   84

Definition at line 106 of file pano_unwrap.c.

Referenced by unwrap_LUT().

#define RED_V   255

Definition at line 107 of file pano_unwrap.c.

Referenced by unwrap_LUT().

#define RED_Y   76

Definition at line 105 of file pano_unwrap.c.

Referenced by unwrap_LUT().

Function Documentation

static struct image_t* camera_cb ( struct image_t img)
static

Definition at line 303 of file pano_unwrap.c.

References pano_unwrap_t::overwrite_video_thread, pano_unwrapped_image, image_t::pprz_ts, set_output_image_size(), image_t::ts, unwrap_LUT(), and update_LUT().

Referenced by pano_unwrap_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void pano_unwrap_init ( void  )

Definition at line 313 of file pano_unwrap.c.

References camera_cb(), cv_add_to_device(), image_create(), IMAGE_YUV422, PANO_UNWRAP_CAMERA, PANO_UNWRAP_FPS, pano_unwrapped_image, and set_output_image_size().

+ Here is the call graph for this function:

static void set_output_image_size ( void  )
static

Definition at line 132 of file pano_unwrap.c.

References image_t::h, pano_unwrap_t::height, image_create(), image_free(), IMAGE_YUV422, pano_unwrapped_image, pano_unwrap_t::radius_bottom, pano_unwrap_t::radius_top, pano_unwrap_t::vertical_resolution, image_t::w, and pano_unwrap_t::width.

Referenced by camera_cb(), and pano_unwrap_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void unwrap_LUT ( struct image_t img_raw,
struct image_t img 
)
static

Variable Documentation

struct LUT_t LUT
static

Definition at line 130 of file pano_unwrap.c.

Referenced by unwrap_LUT(), and update_LUT().

struct pano_unwrap_t pano_unwrap
Initial value:
= {
.center = {
},
.radius_bottom = PANO_UNWRAP_RADIUS_BOTTOM,
.radius_top = PANO_UNWRAP_RADIUS_TOP,
.forward_direction = PANO_UNWRAP_FORWARD_DIRECTION,
.flip_horizontal = PANO_UNWRAP_FLIP_HORIZONTAL,
.vertical_resolution = PANO_UNWRAP_VERTICAL_RESOLUTION,
.derotate_attitude = PANO_UNWRAP_DEROTATE_ATTITUDE,
.height = PANO_UNWRAP_HEIGHT,
.overwrite_video_thread = PANO_UNWRAP_OVERWRITE_VIDEO_THREAD,
.show_calibration = FALSE,
}
#define PANO_UNWRAP_WIDTH
Definition: pano_unwrap.c:64
#define PANO_UNWRAP_FLIP_HORIZONTAL
Definition: pano_unwrap.c:53
#define PANO_UNWRAP_RADIUS_BOTTOM
Definition: pano_unwrap.c:44
#define FALSE
Definition: std.h:5
#define PANO_UNWRAP_CENTER_X
Definition: pano_unwrap.c:38
#define PANO_UNWRAP_FORWARD_DIRECTION
Definition: pano_unwrap.c:50
#define PANO_UNWRAP_OVERWRITE_VIDEO_THREAD
Definition: pano_unwrap.c:71
#define PANO_UNWRAP_DEROTATE_ATTITUDE
Definition: pano_unwrap.c:60
#define PANO_UNWRAP_VERTICAL_RESOLUTION
Definition: pano_unwrap.c:57
#define PANO_UNWRAP_CENTER_Y
Definition: pano_unwrap.c:41
#define PANO_UNWRAP_RADIUS_TOP
Definition: pano_unwrap.c:47
#define PANO_UNWRAP_HEIGHT
Definition: pano_unwrap.c:67

Definition at line 78 of file pano_unwrap.c.

Referenced by update_LUT().

struct image_t pano_unwrapped_image

Unwrapped panoramic image.

Definition at line 99 of file pano_unwrap.c.

Referenced by camera_cb(), pano_unwrap_init(), set_output_image_size(), and update_LUT().