projective_cam.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef __FIREVISION_PROJECTIVE_CAM_H__
00026 #define __FIREVISION_PROJECTIVE_CAM_H__
00027
00028 #include <geometry/hom_transform.h>
00029 #include <fvutils/base/types.h>
00030 #include "calibration.h"
00031
00032 #include <core/exception.h>
00033
00034 class AboveHorizonException : public fawkes::Exception {
00035 public:
00036 AboveHorizonException(const char *msg, const center_in_roi_t img_pt) throw();
00037
00038 const center_in_roi_t& get_img_pt() const;
00039
00040 private:
00041 center_in_roi_t __img_pt;
00042 };
00043
00044 class ProjectiveCam
00045 {
00046 public:
00047 ProjectiveCam(const ProjectiveCam& pc);
00048 virtual ~ProjectiveCam();
00049
00050
00051
00052 virtual ProjectiveCam& set_location(const fawkes::HomTransform& loc);
00053 virtual ProjectiveCam& set_location(float roll, float pitch, float yaw, float height, float x = 0, float y = 0);
00054
00055 virtual fawkes::cart_coord_2d_t get_GPA_world_coord(const center_in_roi_t &img_p) const;
00056 virtual center_in_roi_t get_GPA_image_coord(const fawkes::cart_coord_2d_t &wld_p) const;
00057
00058 virtual void print_info (const char* name = 0, const char *col_sep = 0, const char *row_sep = 0) const;
00059
00060 protected:
00061 ProjectiveCam(const Calibration &cal, const fawkes::HomTransform *loc = 0);
00062 ProjectiveCam(const Calibration &cal, float roll, float pitch, float yaw, float height, float x = 0, float y = 0);
00063 Calibration get_cal() const;
00064
00065 fawkes::Matrix get_p() const;
00066 fawkes::Matrix get_GPA_p() const;
00067
00068 private:
00069 Calibration __cal;
00070 fawkes::Matrix *__p;
00071 fawkes::Matrix *__gpa_inv;
00072 float *__gpa_inv_data;
00073 };
00074
00075 #endif // __FIREVISION_PROJECTIVE_CAM_H__