00001 #ifndef bcam_CAMERA_H__ 00002 #define bcam_CAMERA_H__ 00003 //#===================================================================================== 00004 //# 00005 //# Filename: bcal_camera.h 00006 //# 00007 //# Description: 00008 //# 00009 //# Version: 1.0 00010 //# Created: 03/16/2003 00011 //# Revision: none 00012 //# Compiler: MSVC 00013 //# 00014 //# Author: Kongbin Kang (kk) 00015 //# Company: Brown University 00016 //# Email: kk@lems.brown.edu 00017 //# 00018 //#===================================================================================== 00019 00020 #include <vnl/vnl_double_3x3.h> 00021 #include <vcl_vector.h> 00022 00023 // a structure used to store the lens distortion parameters 00024 // It provides facility for setting it on and off. 00025 // The definition of each bit is given in Brown's paper. 00026 00027 class bcal_lens_model 00028 { 00029 double kc_[7]; 00030 bool flags_[7]; // to show which distortion is on 00031 public: 00032 bcal_lens_model() { 00033 for (int i=0; i<7; i++) { 00034 kc_[i] = 0; 00035 flags_[i] = false; 00036 } 00037 } 00038 00039 double& operator[](int i) {return kc_[i];} 00040 bool is_on(int i) { return flags_[i];} 00041 inline void turn_on(int i) { flags_[i] = true;} 00042 inline void turn_off(int i) { flags_[i] = false;} 00043 }; 00044 00045 00046 // an abstract camera definition. 00047 // it store the lens model and intrisic parameter of camera 00048 class bcal_camera 00049 { 00050 int id_; 00051 vnl_double_3x3 k_; 00052 bcal_lens_model lm_; 00053 public: 00054 int getID() { return id_;} 00055 vnl_double_3x3 get_intrisic_matrix(){ return k_;} 00056 void set_lens_model(vcl_vector<bool> flags); 00057 00058 void set_intrisic_matrix(vnl_double_3x3 k) {k_ = k;} 00059 00060 bcal_camera(int id); 00061 ~bcal_camera(){} 00062 }; 00063 00064 #endif // bcam_CAMERA_H__
1.5.1