Main Page   Modules   Compound List   File List   Compound Members   File Members  

camera.h

Go to the documentation of this file.
00001 
00014 /* This library is free software; you can redistribute it and/or
00015    modify it under the terms of the GNU Lesser General Public
00016    License as published by the Free Software Foundation; either
00017    version 2.1 of the License, or (at your option) any later version.
00018 
00019    This library is distributed in the hope that it will be useful,
00020    but WITHOUT ANY WARRANTY; without even the implied warranty of
00021    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00022    Lesser General Public License for more details.
00023 
00024    You should have received a copy of the GNU Lesser General Public
00025    License along with this library; if not, write to the Free Software
00026    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00027 */
00028 
00029 #ifndef _GAN_CAMERA_H
00030 #define _GAN_CAMERA_H
00031 
00032 #include <stdio.h>
00033 #include <gandalf/common/misc_defs.h>
00034 #include <gandalf/vision/camera_defs.h>
00035 #include <gandalf/linalg/3x3matrix.h>
00036 #include <gandalf/linalg/3vector.h>
00037 
00038 #ifdef __cplusplus
00039 extern "C" {
00040 #endif
00041 
00055 typedef struct Gan_Camera
00056 {
00058    Gan_CameraType type;
00059 
00061 
00063    double fx, fy;
00064 
00066    double x0, y0;
00067 
00069    double zh;
00070 
00081    union
00082    {
00083       struct
00084       {
00086          double K1;
00087 
00089          double thres_R2, thres_dR;
00090 
00092          double outer_a, outer_b;
00093       } radial1;
00094 
00095       struct
00096       {
00098          double K1, K2;
00099 
00101          double thres_R2, thres_dR;
00102 
00104          double outer_a, outer_b;
00105       } radial2;
00106 
00107       struct
00108       {
00110          double K1, K2, K3;
00111 
00113          double thres_R2, thres_dR;
00114 
00116          double outer_a, outer_b;
00117       } radial3;
00118 
00119       struct { double cxx, cxy, cyx, cyy; } xydist4;
00120    } nonlinear;
00121 
00123    double gamma;
00124 
00126    struct
00127    {
00129       Gan_Bool (*project) ( struct Gan_Camera *camera,
00130                             Gan_Vector3 *X, Gan_Vector3 *p,
00131                             Gan_Matrix22 *HX, struct Gan_Camera *HC,
00132                             int *error_code );
00133 
00135       Gan_Bool (*backproject) ( struct Gan_Camera *camera,
00136                                 Gan_Vector3 *p, Gan_Vector3 *X,
00137                                 int *error_code );
00138 
00140       Gan_Bool (*add_distortion) ( struct Gan_Camera *camera,
00141                                    Gan_Vector3 *pu, Gan_Vector3 *p,
00142                                    int *error_code );
00143 
00145       Gan_Bool (*remove_distortion) ( struct Gan_Camera *camera,
00146                                       Gan_Vector3 *p, Gan_Vector3 *pu,
00147                                       int *error_code);
00148    } point;
00149 
00151    struct
00152    {
00154       Gan_Bool (*project) ( struct Gan_Camera *camera,
00155                             Gan_Vector3 *L, Gan_Vector3 *l );
00156 
00158       Gan_Bool (*backproject) ( struct Gan_Camera *camera,
00159                                 Gan_Vector3 *l, Gan_Vector3 *L );
00160    } line;
00161 } Gan_Camera;
00162 
00163 Gan_Bool gan_camera_build_va ( Gan_Camera *camera,
00164                                Gan_CameraType type,
00165                                double zh, double fx, double fy,
00166                                double x0, double y0, ... );
00167 Gan_Bool gan_camera_internalize ( Gan_Camera *camera );
00168 Gan_Bool gan_camera_set_gamma ( Gan_Camera *camera, double gamma );
00169 Gan_SquMatrix33 gan_camera_fill_matrix_s ( Gan_Camera *camera );
00170 
00194 Gan_Bool
00195  gan_camera_project_point_gen ( Gan_Camera *camera,
00196                                 Gan_Vector3 *X, Gan_Vector3 *p,
00197                                 Gan_Matrix22 *HX, Gan_Camera HC[2],
00198                                 int *error_code );
00199 
00216 Gan_Bool
00217  gan_camera_project_point ( Gan_Camera *camera,
00218                             Gan_Vector3 *X, Gan_Vector3 *p,
00219                             int *error_code );
00220 
00239 Gan_Bool
00240  gan_camera_project_point_q ( Gan_Camera *camera,
00241                               Gan_Vector3 *X, Gan_Vector3 *p );
00242 
00260 Gan_Bool
00261  gan_camera_project_point_i ( Gan_Camera *camera, Gan_Vector3 *X );
00262 
00282 Gan_Bool
00283  gan_camera_backproject_point ( Gan_Camera *camera,
00284                                 Gan_Vector3 *p, Gan_Vector3 *X,
00285                                 int *error_code );
00286 
00307 Gan_Bool
00308  gan_camera_backproject_point_q ( Gan_Camera *camera,
00309                                   Gan_Vector3 *p, Gan_Vector3 *X );
00310 
00330 Gan_Bool
00331  gan_camera_backproject_point_i ( Gan_Camera *camera,
00332                                   Gan_Vector3 *p );
00333 
00350 Gan_Bool
00351  gan_camera_add_distortion ( Gan_Camera *camera,
00352                              Gan_Vector3 *pu, Gan_Vector3 *p,
00353                              int *error_code );
00354 
00372 Gan_Bool
00373  gan_camera_add_distortion_q ( Gan_Camera *camera,
00374                                Gan_Vector3 *pu, Gan_Vector3 *p );
00375 
00391 Gan_Bool
00392  gan_camera_add_distortion_i ( Gan_Camera *camera, Gan_Vector3 *p );
00393 
00408 Gan_Bool
00409  gan_camera_remove_distortion ( Gan_Camera *camera,
00410                                 Gan_Vector3 *p, Gan_Vector3 *pu,
00411                                 int *error_code );
00412 
00429 Gan_Bool
00430  gan_camera_remove_distortion_q ( Gan_Camera *camera,
00431                                   Gan_Vector3 *p, Gan_Vector3 *pu );
00432 
00448 Gan_Bool
00449  gan_camera_remove_distortion_i ( Gan_Camera *camera, Gan_Vector3 *p );
00450 
00467 Gan_Bool
00468  gan_camera_project_line_q ( Gan_Camera *camera,
00469                              Gan_Vector3 *L, Gan_Vector3 *l );
00470 
00487 Gan_Bool
00488  gan_camera_project_line_i ( Gan_Camera *camera, Gan_Vector3 *L );
00489 
00509 Gan_Bool
00510  gan_camera_backproject_line_q ( Gan_Camera *camera,
00511                                  Gan_Vector3 *l, Gan_Vector3 *L );
00512 
00534 Gan_Bool
00535  gan_camera_backproject_line_i ( Gan_Camera *camera, Gan_Vector3 *l );
00536 
00545 #ifdef __cplusplus
00546 }
00547 #endif
00548 
00549 #endif /* #ifndef _GAN_CAMERA_H */

Generated on Mon Oct 13 16:14:32 2003 by doxygen1.3-rc1