00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00033 #ifndef __dgc_camtrans_h__
00034 #define __dgc_camtrans_h__
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 typedef struct _CamTrans CamTrans;
00045
00046 CamTrans * camtrans_new_spherical (double width, double height,
00047 double fx, double fy,
00048 double cx, double cy, double skew,
00049 const double position[3], const double orientation_quat[4],
00050 const double distortion_cx, const double distortion_cy,
00051 double distortion_param);
00052
00053
00054
00055 void camtrans_destroy (CamTrans* t);
00056
00057
00058 void camtrans_compute_matrices (CamTrans *t);
00059
00060
00061
00062 void camtrans_get_position (const CamTrans* t,
00063 double pos[3]);
00064 void camtrans_get_orientation (const CamTrans *t,
00065 double orientation[4]);
00066
00067 void camtrans_get_world_to_cam_matrix (const CamTrans *t, double matrix[12]);
00068 void camtrans_get_cam_to_world_matrix (const CamTrans *t, double matrix[9]);
00069
00070
00071 double camtrans_get_focal_length_x (const CamTrans *t);
00072 double camtrans_get_focal_length_y (const CamTrans *t);
00073 double camtrans_get_image_width (const CamTrans *t);
00074 double camtrans_get_image_height (const CamTrans *t);
00075 double camtrans_get_principal_x (const CamTrans *t);
00076 double camtrans_get_principal_y (const CamTrans *t);
00077 double camtrans_get_width (const CamTrans *t);
00078 double camtrans_get_height (const CamTrans *t);
00079 void camtrans_get_distortion_center (const CamTrans *t, double *x, double *y);
00080
00085 void camtrans_scale_image (CamTrans *t, const double scale_factor);
00086
00087
00092 void camtrans_rotate_camera (CamTrans *t, const double q[4]);
00093
00098 void camtrans_set_distortion_center (CamTrans *t, const double cx,
00099 const double cy);
00100
00101
00102
00103
00104
00105
00111 int camtrans_undistort_pixel (const CamTrans* cam,
00112 const double x, const double y,
00113 double* ox, double* oy);
00114
00120 int camtrans_distort_pixel (const CamTrans* cam,
00121 const double x, const double y,
00122 double* ox, double* oy);
00123
00124
00125 int camtrans_pixel_to_ray (const CamTrans* cam,
00126 const double x, const double y,
00127 double ray[3]);
00128
00135 int camtrans_project_point (const CamTrans* cam,
00136 const double * p_world,
00137 const int distort,
00138 double* ox, double* oy, double *oz);
00139
00145 int camtrans_project_line (const CamTrans *cam,
00146 const double *l_world,
00147 double *ox, double *oy, double *oz);
00148
00149
00150
00151
00152
00153
00154 #endif
00155