Paparazzi UAS  v5.15_devel-113-g1b57ff1
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
undistortion.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) Guido de Croon, 2018
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 
44 #ifndef UNDISTORTION_H
45 #define UNDISTORTION_H
46 
47 #include "std.h"
48 
49 // TODO: add other distortion models than just the Dhane one:
50 bool Dhane_distortion(float x_n, float y_n, float* x_nd, float* y_nd, float k);
51 bool Dhane_undistortion(float x_nd, float y_nd, float* x_n, float* y_n, float k);
52 
53 void normalized_to_pixels(float x_n_, float y_n_, float* x_p, float* y_p, const float* K);
54 void pixels_to_normalized(float x_p, float y_p, float* x_n_, float* y_n_, const float* K);
55 
56 bool distorted_pixels_to_normalized_coords(float x_pd, float y_pd, float* x_n, float* y_n, float k, const float* K);
57 bool normalized_coords_to_distorted_pixels(float x_n, float y_n, float *x_pd, float *y_pd, float k, const float* K);
58 
59 
60 #endif /* UNDISTORTION_H */
void pixels_to_normalized(float x_p, float y_p, float *x_n_, float *y_n_, const float *K)
Transform pixel coordinates to normalized coordinates.
Definition: undistortion.c:113
void normalized_to_pixels(float x_n_, float y_n_, float *x_p, float *y_p, const float *K)
Transform normalized coordinates to pixel coordinates.
Definition: undistortion.c:100
static float K[9]
bool Dhane_distortion(float x_n, float y_n, float *x_nd, float *y_nd, float k)
Distort normalized image coordinates with the invertible Dhane method.
Definition: undistortion.c:57
bool distorted_pixels_to_normalized_coords(float x_pd, float y_pd, float *x_n, float *y_n, float k, const float *K)
Transform distorted pixel coordinates to normalized coordinates.
Definition: undistortion.c:128
bool normalized_coords_to_distorted_pixels(float x_n, float y_n, float *x_pd, float *y_pd, float k, const float *K)
Transform normalized coordinates to distorted pixel coordinates.
Definition: undistortion.c:146
bool Dhane_undistortion(float x_nd, float y_nd, float *x_n, float *y_n, float k)
Undistort distorted normalized image coordinates with the invertible Dhane method.
Definition: undistortion.c:76