corrects distortion in images More...
#include <stdio.h>#include <stdlib.h>#include <math.h>#include <string.h>#include "small_linalg.h"

Go to the source code of this file.
Classes | |
| struct | _CamTrans |
| struct | SphericalDistortion |
|
| |
| #define | CAMERA_EPSILON 1e-10 |
| typedef void(* | warp_func_t )(const double, const double, const void *, double *, double *) |
| void | camtrans_compute_matrices (CamTrans *t) |
| void | camtrans_destroy (CamTrans *t) |
| int | camtrans_distort_pixel (const CamTrans *cam, const double x, const double y, double *ox, double *oy) |
| void | camtrans_get_cam_to_world_matrix (const CamTrans *t, double matrix[9]) |
| void | camtrans_get_distortion_center (const CamTrans *t, double *x, double *y) |
| double | camtrans_get_focal_length_x (const CamTrans *t) |
| double | camtrans_get_focal_length_y (const CamTrans *t) |
| double | camtrans_get_height (const CamTrans *t) |
| double | camtrans_get_image_height (const CamTrans *t) |
| double | camtrans_get_image_width (const CamTrans *t) |
| void | camtrans_get_orientation (const CamTrans *t, double orientation[4]) |
| void | camtrans_get_position (const CamTrans *t, double pos[3]) |
| double | camtrans_get_principal_x (const CamTrans *t) |
| double | camtrans_get_principal_y (const CamTrans *t) |
| double | camtrans_get_width (const CamTrans *t) |
| void | camtrans_get_world_to_cam_matrix (const CamTrans *t, double matrix[12]) |
| CamTrans * | camtrans_new_spherical (double width, double height, double fx, double fy, double cx, double cy, double skew, const double position[3], const double orientation_quat[4], const double distortion_cx, const double distortion_cy, double distortion_param) |
| int | camtrans_pixel_to_ray (const CamTrans *cam, const double x, const double y, double ray[3]) |
| int | camtrans_project_line (const CamTrans *cam, const double *l_world, double *ox, double *oy, double *oz) |
| int | camtrans_project_point (const CamTrans *cam, const double *p_world, const int distort, double *ox, double *oy, double *oz) |
| void | camtrans_rotate_camera (CamTrans *t, const double q[4]) |
| void | camtrans_scale_image (CamTrans *t, const double scale_factor) |
| void | camtrans_set_distortion_center (CamTrans *t, const double cx, const double cy) |
| int | camtrans_undistort_pixel (const CamTrans *cam, const double x, const double y, double *ox, double *oy) |
| static void | spherical_distort_func (const double x, const double y, const void *data, double *ox, double *oy) |
| static SphericalDistortion * | spherical_distortion_create (const double w, const double h, const double cx, const double cy, const double a) |
| static void | spherical_distortion_destroy (SphericalDistortion *dist) |
| static void | spherical_undistort_func (const double x, const double y, const void *data, double *ox, double *oy) |
corrects distortion in images
Definition in file camtrans.cpp.
| #define CAMERA_EPSILON 1e-10 |
Definition at line 43 of file camtrans.cpp.
| typedef void(* warp_func_t)(const double, const double, const void *, double *, double *) |
Definition at line 46 of file camtrans.cpp.
| void camtrans_compute_matrices | ( | CamTrans * | t | ) |
Definition at line 221 of file camtrans.cpp.
| void camtrans_destroy | ( | CamTrans * | t | ) |
Definition at line 211 of file camtrans.cpp.
| int camtrans_distort_pixel | ( | const CamTrans * | cam, | |
| const double | x, | |||
| const double | y, | |||
| double * | ox, | |||
| double * | oy | |||
| ) |
camtrans_distort_pixel:
Produce distorted pixel from rectified pixel.
Definition at line 416 of file camtrans.cpp.
| void camtrans_get_cam_to_world_matrix | ( | const CamTrans * | t, | |
| double | matrix[9] | |||
| ) |
Definition at line 278 of file camtrans.cpp.
| void camtrans_get_distortion_center | ( | const CamTrans * | t, | |
| double * | x, | |||
| double * | y | |||
| ) |
Definition at line 329 of file camtrans.cpp.
| double camtrans_get_focal_length_x | ( | const CamTrans * | t | ) |
Definition at line 286 of file camtrans.cpp.
| double camtrans_get_focal_length_y | ( | const CamTrans * | t | ) |
Definition at line 291 of file camtrans.cpp.
| double camtrans_get_height | ( | const CamTrans * | t | ) |
Definition at line 323 of file camtrans.cpp.
| double camtrans_get_image_height | ( | const CamTrans * | t | ) |
Definition at line 301 of file camtrans.cpp.
| double camtrans_get_image_width | ( | const CamTrans * | t | ) |
Definition at line 296 of file camtrans.cpp.
| void camtrans_get_orientation | ( | const CamTrans * | t, | |
| double | orientation[4] | |||
| ) |
Definition at line 262 of file camtrans.cpp.
| void camtrans_get_position | ( | const CamTrans * | t, | |
| double | pos[3] | |||
| ) |
Definition at line 255 of file camtrans.cpp.
| double camtrans_get_principal_x | ( | const CamTrans * | t | ) |
Definition at line 306 of file camtrans.cpp.
| double camtrans_get_principal_y | ( | const CamTrans * | t | ) |
Definition at line 311 of file camtrans.cpp.
| double camtrans_get_width | ( | const CamTrans * | t | ) |
Definition at line 317 of file camtrans.cpp.
| void camtrans_get_world_to_cam_matrix | ( | const CamTrans * | t, | |
| double | matrix[12] | |||
| ) |
Definition at line 271 of file camtrans.cpp.
| CamTrans* camtrans_new_spherical | ( | double | width, | |
| double | height, | |||
| double | fx, | |||
| double | fy, | |||
| double | cx, | |||
| double | cy, | |||
| double | skew, | |||
| const double | position[3], | |||
| const double | orientation_quat[4], | |||
| const double | distortion_cx, | |||
| const double | distortion_cy, | |||
| double | distortion_param | |||
| ) |
Definition at line 172 of file camtrans.cpp.
| int camtrans_pixel_to_ray | ( | const CamTrans * | cam, | |
| const double | x, | |||
| const double | y, | |||
| double | ray[3] | |||
| ) |
Definition at line 424 of file camtrans.cpp.
| int camtrans_project_line | ( | const CamTrans * | cam, | |
| const double * | l_world, | |||
| double * | ox, | |||
| double * | oy, | |||
| double * | oz | |||
| ) |
Project line in the vehicle body frame to undistorted image pixel coords
Returns: 0 on success, -1 if the resulting line is at infinity
Definition at line 478 of file camtrans.cpp.
| int camtrans_project_point | ( | const CamTrans * | cam, | |
| const double * | p_world, | |||
| const int | distort, | |||
| double * | ox, | |||
| double * | oy, | |||
| double * | oz | |||
| ) |
Project point in the vehicle body frame to image pixel, with optional distortion
Returns: 0 on success, -1 if the point lies on the camera's principal plane
Definition at line 444 of file camtrans.cpp.
| void camtrans_rotate_camera | ( | CamTrans * | t, | |
| const double | q[4] | |||
| ) |
rotate camera by q. the rotation is applied to the camera body.
Definition at line 375 of file camtrans.cpp.
| void camtrans_scale_image | ( | CamTrans * | t, | |
| const double | scale_factor | |||
| ) |
isotropically scale image
Definition at line 341 of file camtrans.cpp.
| void camtrans_set_distortion_center | ( | CamTrans * | t, | |
| const double | cx, | |||
| const double | cy | |||
| ) |
change camera distortion center
Definition at line 390 of file camtrans.cpp.
| int camtrans_undistort_pixel | ( | const CamTrans * | cam, | |
| const double | x, | |||
| const double | y, | |||
| double * | ox, | |||
| double * | oy | |||
| ) |
camtrans_undistort_pixel_exact:
Produce rectified pixel from distorted pixel.
Definition at line 405 of file camtrans.cpp.
| static void spherical_distort_func | ( | const double | x, | |
| const double | y, | |||
| const void * | data, | |||
| double * | ox, | |||
| double * | oy | |||
| ) | [static] |
Definition at line 124 of file camtrans.cpp.
| static SphericalDistortion* spherical_distortion_create | ( | const double | w, | |
| const double | h, | |||
| const double | cx, | |||
| const double | cy, | |||
| const double | a | |||
| ) | [static] |
Definition at line 67 of file camtrans.cpp.
| static void spherical_distortion_destroy | ( | SphericalDistortion * | dist | ) | [static] |
Definition at line 86 of file camtrans.cpp.
| static void spherical_undistort_func | ( | const double | x, | |
| const double | y, | |||
| const void * | data, | |||
| double * | ox, | |||
| double * | oy | |||
| ) | [static] |
Definition at line 94 of file camtrans.cpp.