Main Page   Modules   Compound List   File List   Compound Members   File Members  

cameraf.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_CAMERAF_H
00030 #define _GAN_CAMERAF_H
00031 
00032 #include <stdio.h>
00033 #include <gandalf/common/misc_defs.h>
00034 #include <gandalf/vision/camera_defs.h>
00035 #include <gandalf/linalg/3x3matrixf.h>
00036 #include <gandalf/linalg/3vectorf.h>
00037 
00038 #ifdef __cplusplus
00039 extern "C" {
00040 #endif
00041 
00055 typedef struct Gan_Camera_f
00056 {
00058    Gan_CameraType type;
00059 
00061 
00063    float fx, fy;
00064 
00066    float x0, y0;
00067 
00069    float zh;
00070 
00081    union
00082    {
00083       struct
00084       {
00086          float K1;
00087 
00089          float thres_R2, thres_dR;
00090 
00092          float outer_a, outer_b;
00093       } radial1;
00094 
00095       struct
00096       {
00098          float K1, K2;
00099 
00101          float thres_R2, thres_dR;
00102 
00104          float outer_a, outer_b;
00105       } radial2;
00106 
00107       struct
00108       {
00110          float K1, K2, K3;
00111 
00113          float thres_R2, thres_dR;
00114 
00116          float outer_a, outer_b;
00117       } radial3;
00118 
00119       struct { float cxx, cxy, cyx, cyy; } xydist4;
00120    } nonlinear;
00121 
00123    float gamma;
00124 
00126    struct
00127    {
00129       Gan_Bool (*project) ( struct Gan_Camera_f *camera,
00130                             Gan_Vector3_f *X, Gan_Vector3_f *p,
00131                             Gan_Matrix22_f *HX, struct Gan_Camera_f *HC,
00132                             int *error_code );
00133 
00135       Gan_Bool (*backproject) ( struct Gan_Camera_f *camera,
00136                                 Gan_Vector3_f *p, Gan_Vector3_f *X,
00137                                 int *error_code );
00138 
00140       Gan_Bool (*add_distortion) ( struct Gan_Camera_f *camera,
00141                                    Gan_Vector3_f *pu, Gan_Vector3_f *p,
00142                                    int *error_code );
00143 
00145       Gan_Bool (*remove_distortion) ( struct Gan_Camera_f *camera,
00146                                       Gan_Vector3_f *p, Gan_Vector3_f *pu,
00147                                       int *error_code);
00148    } pointf;
00149 
00151    struct
00152    {
00154       Gan_Bool (*project) ( struct Gan_Camera_f *camera,
00155                             Gan_Vector3_f *L, Gan_Vector3_f *l );
00156 
00158       Gan_Bool (*backproject) ( struct Gan_Camera_f *camera,
00159                                 Gan_Vector3_f *l, Gan_Vector3_f *L );
00160    } linef;
00161 } Gan_Camera_f;
00162 
00163 Gan_Bool gan_cameraf_build_va ( Gan_Camera_f *camera, Gan_CameraType type,
00164                                 float zh,
00165                                 float fx, float fy, float x0, float y0,
00166                                 ... );
00167 Gan_Bool gan_cameraf_internalize ( Gan_Camera_f *camera );
00168 Gan_Bool gan_cameraf_set_gamma ( Gan_Camera_f *camera, float gamma );
00169 Gan_SquMatrix33_f gan_cameraf_fill_matrix_s ( Gan_Camera_f *camera );
00170 
00194 Gan_Bool
00195  gan_cameraf_project_point_gen ( Gan_Camera_f *camera,
00196                                  Gan_Vector3_f *X, Gan_Vector3_f *p,
00197                                  Gan_Matrix22_f *HX, Gan_Camera_f HC[2],
00198                                  int *error_code );
00199 
00216 Gan_Bool
00217  gan_cameraf_project_point ( Gan_Camera_f *camera,
00218                              Gan_Vector3_f *X, Gan_Vector3_f *p,
00219                              int *error_code );
00220 
00239 Gan_Bool
00240  gan_cameraf_project_point_q ( Gan_Camera_f *camera,
00241                                Gan_Vector3_f *X, Gan_Vector3_f *p );
00242 
00260 Gan_Bool
00261  gan_cameraf_project_point_i ( Gan_Camera_f *camera, Gan_Vector3_f *X );
00262 
00282 Gan_Bool
00283  gan_cameraf_backproject_point ( Gan_Camera_f *camera,
00284                                  Gan_Vector3_f *p, Gan_Vector3_f *X,
00285                                  int *error_code );
00286 
00307 Gan_Bool
00308  gan_cameraf_backproject_point_q ( Gan_Camera_f *camera,
00309                                    Gan_Vector3_f *p, Gan_Vector3_f *X );
00310 
00330 Gan_Bool
00331  gan_cameraf_backproject_point_i ( Gan_Camera_f *camera,
00332                                    Gan_Vector3_f *p );
00333 
00350 Gan_Bool
00351  gan_cameraf_add_distortion ( Gan_Camera_f *camera,
00352                               Gan_Vector3_f *pu, Gan_Vector3_f *p,
00353                               int *error_code );
00354 
00372 Gan_Bool
00373  gan_cameraf_add_distortion_q ( Gan_Camera_f *camera,
00374                                 Gan_Vector3_f *pu, Gan_Vector3_f *p );
00375 
00391 Gan_Bool
00392  gan_cameraf_add_distortion_i ( Gan_Camera_f *camera, Gan_Vector3_f *p );
00393 
00408 Gan_Bool
00409  gan_cameraf_remove_distortion ( Gan_Camera_f *camera,
00410                                  Gan_Vector3_f *p, Gan_Vector3_f *pu,
00411                                  int *error_code );
00412 
00429 Gan_Bool
00430  gan_cameraf_remove_distortion_q ( Gan_Camera_f *camera,
00431                                    Gan_Vector3_f *p, Gan_Vector3_f *pu );
00432 
00448 Gan_Bool
00449  gan_cameraf_remove_distortion_i ( Gan_Camera_f *camera, Gan_Vector3_f *p );
00450 
00467 Gan_Bool
00468  gan_cameraf_project_line_q ( Gan_Camera_f *camera,
00469                               Gan_Vector3_f *L, Gan_Vector3_f *l );
00470 
00487 Gan_Bool
00488  gan_cameraf_project_line_i ( Gan_Camera_f *camera, Gan_Vector3_f *L );
00489 
00509 Gan_Bool
00510  gan_cameraf_backproject_line_q ( Gan_Camera_f *camera,
00511                                   Gan_Vector3_f *l, Gan_Vector3_f *L );
00512 
00534 Gan_Bool
00535  gan_cameraf_backproject_line_i ( Gan_Camera_f *camera, Gan_Vector3_f *l );
00536 
00545 #ifdef __cplusplus
00546 }
00547 #endif
00548 
00549 #endif /* #ifndef _GAN_CAMERAF_H */

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