Main Page | Modules | Class List | Directories | File List | Class 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_RadialBasisFunction
00056 {
00058    double x, y;
00059 
00061    double dist2_thres;
00062 
00064    double weight;
00065 
00067    double normaliser;
00068 
00070    double dx, dy;
00071 
00072 } Gan_RadialBasisFunction;
00073 
00077 typedef struct Gan_Camera
00078 {
00080    Gan_CameraType type;
00081 
00083 
00085    double fx, fy, fy_over_fx;
00086 
00088    double x0, y0;
00089 
00091    double zh;
00092 
00103    union
00104    {
00105       struct
00106       {
00108          double K1;
00109 
00111          double thres_R2, thres_dR;
00112 
00114          double outer_a, outer_b;
00115       } radial1;
00116 
00117       struct
00118       {
00120          double K1, K2;
00121 
00123          double thres_R2, thres_dR;
00124 
00126          double outer_a, outer_b;
00127       } radial2;
00128 
00129       struct
00130       {
00132          double K1, K2, K3;
00133 
00135          double thres_R2, thres_dR;
00136 
00138          double outer_a, outer_b;
00139       } radial3;
00140 
00141       struct { double cxx, cxy, cyx, cyy; } xydist4;
00142 
00143       struct
00144       {
00145          double xla, xlp, xha, xhp;
00146          double yla, ylp, yha, yhp;
00147       } fcwarp;
00148 
00149       struct
00150       {
00152          double skew, kyx, kzx, kzy;
00153 
00155          Gan_Matrix33 K, Kinv;
00156 
00158          Gan_Vector2 weight[1 + (1 << 4)][1 + (1 << 4)];
00159       } cbspline;
00160    } nonlinear;
00161 
00163    struct
00164    {
00166       Gan_Bool (*project) ( const struct Gan_Camera *camera,
00167                             Gan_Vector3 *X, Gan_Vector3 *p,
00168                             Gan_Matrix22 *HX, struct Gan_Camera *HC,
00169                             int *error_code );
00170 
00172       Gan_Bool (*backproject) ( const struct Gan_Camera *camera,
00173                                 Gan_Vector3 *p, Gan_Vector3 *X,
00174                                 int *error_code );
00175 
00177       Gan_Bool (*add_distortion) ( const struct Gan_Camera *camera,
00178                                    Gan_Vector3 *pu, Gan_Vector3 *p,
00179                                    int *error_code );
00180 
00182       Gan_Bool (*remove_distortion) ( const struct Gan_Camera *camera,
00183                                       Gan_Vector3 *p, Gan_Vector3 *pu,
00184                                       int *error_code);
00185    } point;
00186 
00188    struct
00189    {
00191       Gan_Bool (*project) ( const struct Gan_Camera *camera,
00192                             Gan_Vector3 *L, Gan_Vector3 *l );
00193 
00195       Gan_Bool (*backproject) ( const struct Gan_Camera *camera,
00196                                 Gan_Vector3 *l, Gan_Vector3 *L );
00197    } line;
00198 } Gan_Camera;
00199 
00200 Gan_Bool gan_camera_build_va ( Gan_Camera *camera,
00201                                Gan_CameraType type,
00202                                double zh, double fx, double fy,
00203                                double x0, double y0, ... );
00204 Gan_Bool gan_camera_internalize ( Gan_Camera *camera );
00205 Gan_Bool gan_camera_identical ( Gan_Camera *camera1, Gan_Camera *pcamera2 );
00206 Gan_SquMatrix33 gan_camera_fill_matrix_s ( const Gan_Camera *camera );
00207 Gan_Matrix33    gan_camera_fill_fullmatrix_s ( const Gan_Camera *camera );
00208 
00209 Gan_Bool gan_camera_set_common_fields ( Gan_Camera *camera,
00210                                         Gan_CameraType type,
00211                                         double zh, double fx, double fy,
00212                                         double x0, double y0 );
00213 
00237 Gan_Bool
00238  gan_camera_project_point_gen ( const Gan_Camera *camera,
00239                                 Gan_Vector3 *X, Gan_Vector3 *p,
00240                                 Gan_Matrix22 *HX, Gan_Camera HC[2],
00241                                 int *error_code );
00242 
00259 Gan_Bool
00260  gan_camera_project_point ( const Gan_Camera *camera,
00261                             Gan_Vector3 *X, Gan_Vector3 *p,
00262                             int *error_code );
00263 
00282 Gan_Bool
00283  gan_camera_project_point_q ( const Gan_Camera *camera,
00284                               Gan_Vector3 *X, Gan_Vector3 *p );
00285 
00303 Gan_Bool
00304  gan_camera_project_point_i ( const Gan_Camera *camera, Gan_Vector3 *X );
00305 
00325 Gan_Bool
00326  gan_camera_backproject_point ( const Gan_Camera *camera,
00327                                 Gan_Vector3 *p, Gan_Vector3 *X,
00328                                 int *error_code );
00329 
00350 Gan_Bool
00351  gan_camera_backproject_point_q ( const Gan_Camera *camera,
00352                                   Gan_Vector3 *p, Gan_Vector3 *X );
00353 
00373 Gan_Bool
00374  gan_camera_backproject_point_i ( const Gan_Camera *camera,
00375                                   Gan_Vector3 *p );
00376 
00393 Gan_Bool
00394  gan_camera_add_distortion ( const Gan_Camera *camera,
00395                              Gan_Vector3 *pu, Gan_Vector3 *p,
00396                              int *error_code );
00397 
00415 Gan_Bool
00416  gan_camera_add_distortion_q ( const Gan_Camera *camera,
00417                                Gan_Vector3 *pu, Gan_Vector3 *p );
00418 
00434 Gan_Bool
00435  gan_camera_add_distortion_i ( const Gan_Camera *camera, Gan_Vector3 *p );
00436 
00451 Gan_Bool
00452  gan_camera_remove_distortion ( const Gan_Camera *camera,
00453                                 Gan_Vector3 *p, Gan_Vector3 *pu,
00454                                 int *error_code );
00455 
00472 Gan_Bool
00473  gan_camera_remove_distortion_q ( const Gan_Camera *camera,
00474                                   Gan_Vector3 *p, Gan_Vector3 *pu );
00475 
00491 Gan_Bool
00492  gan_camera_remove_distortion_i ( const Gan_Camera *camera, Gan_Vector3 *p );
00493 
00510 Gan_Bool
00511  gan_camera_project_line_q ( const Gan_Camera *camera,
00512                              Gan_Vector3 *L, Gan_Vector3 *l );
00513 
00530 Gan_Bool
00531  gan_camera_project_line_i ( const Gan_Camera *camera, Gan_Vector3 *L );
00532 
00552 Gan_Bool
00553  gan_camera_backproject_line_q ( const Gan_Camera *camera,
00554                                  Gan_Vector3 *l, Gan_Vector3 *L );
00555 
00577 Gan_Bool
00578  gan_camera_backproject_line_i ( const Gan_Camera *camera, Gan_Vector3 *l );
00579 
00588 #ifdef __cplusplus
00589 }
00590 #endif
00591 
00592 #endif /* #ifndef _GAN_CAMERA_H */

Generated on Sat May 21 23:52:47 2005 by  doxygen 1.4.3