Fawkes API
Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * projective_cam.h - Abstract class defining a projective camera model 00004 * 00005 * Created: Thu May 08 15:08:00 2008 00006 * Copyright 2008 Christof Rath <c.rath@student.tugraz.at> 00007 * 00008 ****************************************************************************/ 00009 00010 /* This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. A runtime exception applies to 00014 * this software (see LICENSE.GPL_WRE file mentioned below for details). 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU Library General Public License for more details. 00020 * 00021 * Read the full text in the LICENSE.GPL_WRE file in the doc directory. 00022 */ 00023 00024 #ifndef __FIREVISION_PROJECTIVE_CAM_H__ 00025 #define __FIREVISION_PROJECTIVE_CAM_H__ 00026 00027 #include <models/camera/calibration.h> 00028 #include <geometry/hom_transform.h> 00029 #include <fvutils/base/types.h> 00030 00031 #include <core/exception.h> 00032 00033 namespace firevision { 00034 #if 0 /* just to make Emacs auto-indent happy */ 00035 } 00036 #endif 00037 00038 class AboveHorizonException : public fawkes::Exception 00039 { 00040 public: 00041 AboveHorizonException(const char *msg, const center_in_roi_t img_pt) throw(); 00042 00043 const center_in_roi_t& get_img_pt() const; 00044 00045 private: 00046 center_in_roi_t __img_pt; 00047 }; 00048 00049 class ProjectiveCam 00050 { 00051 public: 00052 ProjectiveCam(const ProjectiveCam& pc); 00053 virtual ~ProjectiveCam(); 00054 00055 //virtual HomTransform get_inverse() const; 00056 00057 virtual ProjectiveCam& set_location(const fawkes::HomTransform& loc); 00058 virtual ProjectiveCam& set_location(float roll, float pitch, float yaw, float height, float x = 0, float y = 0); 00059 00060 virtual fawkes::cart_coord_2d_t get_GPA_world_coord(const center_in_roi_t &img_p) const; 00061 virtual center_in_roi_t get_GPA_image_coord(const fawkes::cart_coord_2d_t &wld_p) const; 00062 00063 virtual void print_info (const char* name = 0, const char *col_sep = 0, const char *row_sep = 0) const; 00064 00065 protected: 00066 ProjectiveCam(const Calibration &cal, const fawkes::HomTransform *loc = 0); 00067 ProjectiveCam(const Calibration &cal, float roll, float pitch, float yaw, float height, float x = 0, float y = 0); 00068 Calibration get_cal() const; 00069 00070 fawkes::Matrix get_p() const; 00071 fawkes::Matrix get_GPA_p() const; 00072 00073 private: 00074 Calibration __cal; 00075 fawkes::Matrix *__p; 00076 fawkes::Matrix *__gpa_inv; 00077 float *__gpa_inv_data; 00078 }; 00079 00080 } // end namespace firevision 00081 00082 #endif // __FIREVISION_PROJECTIVE_CAM_H__