Fawkes API  Fawkes Development Version
projective_cam.h
1 
2 /***************************************************************************
3  * projective_cam.h - Abstract class defining a projective camera model
4  *
5  * Created: Thu May 08 15:08:00 2008
6  * Copyright 2008 Christof Rath <c.rath@student.tugraz.at>
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef __FIREVISION_PROJECTIVE_CAM_H__
25 #define __FIREVISION_PROJECTIVE_CAM_H__
26 
27 #include <fvmodels/camera/calibration.h>
28 #include <geometry/hom_transform.h>
29 #include <fvutils/base/types.h>
30 
31 #include <core/exception.h>
32 
33 namespace firevision {
34 #if 0 /* just to make Emacs auto-indent happy */
35 }
36 #endif
37 
39 {
40  public:
41  AboveHorizonException(const char *msg, const center_in_roi_t img_pt) throw();
42 
43  const center_in_roi_t& get_img_pt() const;
44 
45  private:
46  center_in_roi_t __img_pt;
47 };
48 
50 {
51  public:
52  ProjectiveCam(const ProjectiveCam& pc);
53  virtual ~ProjectiveCam();
54 
55  //virtual HomTransform get_inverse() const;
56 
57  virtual ProjectiveCam& set_location(const fawkes::HomTransform& loc);
58  virtual ProjectiveCam& set_location(float roll, float pitch, float yaw, float height, float x = 0, float y = 0);
59 
60  virtual fawkes::cart_coord_2d_t get_GPA_world_coord(const center_in_roi_t &img_p) const;
61  virtual center_in_roi_t get_GPA_image_coord(const fawkes::cart_coord_2d_t &wld_p) const;
62 
63  virtual void print_info (const char* name = 0, const char *col_sep = 0, const char *row_sep = 0) const;
64 
65  protected:
66  ProjectiveCam(const Calibration &cal, const fawkes::HomTransform *loc = 0);
67  ProjectiveCam(const Calibration &cal, float roll, float pitch, float yaw, float height, float x = 0, float y = 0);
68  Calibration get_cal() const;
69 
70  fawkes::Matrix get_p() const;
71  fawkes::Matrix get_GPA_p() const;
72 
73  private:
74  Calibration __cal;
75  fawkes::Matrix *__p;
76  fawkes::Matrix *__gpa_inv;
77  float *__gpa_inv_data;
78 };
79 
80 } // end namespace firevision
81 
82 #endif // __FIREVISION_PROJECTIVE_CAM_H__
Cartesian coordinates (2D).
Definition: types.h:40
The point that should be calculated lies above the horizon.
A general matrix class.
Definition: matrix.h:33
A Calibration matrix for a finite camera.
Definition: calibration.h:35
This class describes a homogeneous transformation.
Definition: hom_transform.h:31
Abstract class for projective cameras.
Base class for exceptions in Fawkes.
Definition: exception.h:36
Center in ROI.
Definition: types.h:39