Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Functions for undistorting camera images. More...
Go to the source code of this file.
Functions | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
Functions for undistorting camera images.
The lenses of most cameras distort the image, in the sense that it does not represent a linear projection of points in the world. Specifically, straight lines in the world get curved in the image, as the lens compresses the data more and more towards the edges of the image.
Reading:
Some definitions:
Definition in file undistortion.c.
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.
This can be useful for undistorting an entire image. We assume f, the focal length, to be 1 here. That is why it is missing from the below formula.
[in] | x_n | The undistorted normalized x coordinate |
[in] | y_n | The undistorted normalized y coordinate |
[in] | k | The single parameter of Dhane's model, typically found empirically by checking if straight lines in the world are straight in an undistorted image. |
[out] | *x_nd | The distorted normalized x coordinate |
[out] | *y_nd | The distorted normalized y coordinate |
Definition at line 57 of file undistortion.c.
Referenced by normalized_coords_to_distorted_pixels().
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.
We assume f, the focal length, to be 1 here. That is why it is missing from the below formula.
[out] | *x_n | The undistorted normalized x coordinate |
[out] | *y_n | The undistorted normalized y coordinate |
[in] | k | The single parameter of Dhane's model, typically found empirically by checking if straight lines in the world are straight in an undistorted image. |
[in] | x_nd | The distorted normalized x coordinate |
[in] | y_nd | The distorted normalized y coordinate |
Definition at line 76 of file undistortion.c.
Referenced by distorted_pixels_to_normalized_coords().
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.
[out] | *x_n | The undistorted normalized x coordinate |
[out] | *y_n | The undistorted normalized y coordinate |
[in] | k | The single parameter of Dhane's model, typically found empirically by checking if straight lines in the world are straight in an undistorted image. |
[in] | *K | The camera calibration matrix, as a single array in row-major form, so K00, K01, K02, K10, K11, ... |
[in] | x_pd | The distorted pixel x coordinate |
[in] | y_pd | The distorted pixel y coordinate |
Definition at line 128 of file undistortion.c.
References Dhane_undistortion(), K, and pixels_to_normalized().
Referenced by get_world_position_from_image_points(), and predict_flow_vectors().
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.
[in] | x_n | The undistorted normalized x coordinate |
[in] | y_n | The undistorted normalized y coordinate |
[in] | k | The single parameter of Dhane's model, typically found empirically by checking if straight lines in the world are straight in an undistorted image. |
[in] | *K | The camera calibration matrix, as a single array in row-major form, so K00, K01, K02, K10, K11, ... |
[out] | *x_pd | The distorted pixel x coordinate |
[out] | *y_pd | The distorted pixel y coordinate |
Definition at line 146 of file undistortion.c.
References Dhane_distortion(), K, and normalized_to_pixels().
Referenced by predict_flow_vectors(), and undistort_image_func().
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.
[in] | x_n | The undistorted normalized x coordinate |
[in] | y_n | The undistorted normalized y coordinate |
[in] | *K | The camera calibration matrix, as a single array in row-major form, so K00, K01, K02, K10, K11, ... |
[out] | *x_p | The pixel x coordinate |
[out] | *y_p | The pixel y coordinate |
Definition at line 100 of file undistortion.c.
References K.
Referenced by normalized_coords_to_distorted_pixels().
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.
[out] | *x_n | The undistorted normalized x coordinate |
[out] | *y_n | The undistorted normalized y coordinate |
[in] | *K | The camera calibration matrix, as a single array in row-major form, so K00, K01, K02, K10, K11, ... |
[in] | x_p | The pixel x coordinate |
[in] | y_p | The pixel y coordinate |
Definition at line 113 of file undistortion.c.
References K.
Referenced by distorted_pixels_to_normalized_coords().