bazar  1.3.1
CamAugmentation.h
Go to the documentation of this file.
1 #ifndef _CAMAUGMENTATION_H
2 #define _CAMAUGMENTATION_H
3 
4 #include "CamCalibration.h"
5 
6 struct PoseObs;
7 
26 
27 public:
32 
40 
46  void AddHomography();
47 
59  void AddHomography( std::vector<CamCalibration::s_struct_points> p, CvMat* ready );
60 
72  bool Accomodate( int iter, double eps );
73 
80  void Clear();
81 
91  CvMat* GetProjectionMatrix( int c );
92 
98  CvMat* GetRefProjectionMatrix( int c );
99 
101  CvMat *GetCamEyeMatrix( int c );
102 
104  CvMat* GetObjectToWorld();
105 
117  bool LoadOptimalStructureFromFile( char* cam_c_file, char *cam_rt_file );
118 
119  void ClearAll();
120 
121 private:
122 
130  struct s_struct_optimal {
131  std::vector<int> v_camera_width;
132  std::vector<int> v_camera_height;
133  std::vector<CvMat*> v_camera_c;
134  std::vector<CvMat*> v_camera_r_t;
135  std::vector<CvMat*> v_camera_r_t_jacobian;
136  };
137 
145  s_struct_optimal s_optimal;
146 
155  struct s_struct_homography {
156  std::vector<CamCalibration::s_struct_points> v_point;
157  homography* m_homography;
158 
159  s_struct_homography(){
160  m_homography = NULL;
161  }
162  ~s_struct_homography(){
163  v_point.clear();
164  delete m_homography;
165  }
166  };
167 
175  std::vector<s_struct_homography*> v_homography;
176 
184  CvMat* v_homography_r_t; //TODO: warum v?? m!!!
185 
191  CvMat* v_homography_r_t_jacobian;
192 
201  std::vector<double> v_opt_param;
202 
211  bool EstimateHomographyRT();
212 
218  CvMat* InverseCalibrationMatrix( CvMat *in );
219 
227  bool CreateHomographyRotationTranslationMatrix( int c );
228 
235  bool OptimizeCurrentView( int iter, double eps );
236 
240  int GetObservationNumber();
241 
245  void GetParameterSet();
246 
250  void SetParameterSet();
251 
257  static void updateCB(double *params, void **user_data);
258 
264  //static void PrintIterationResult( double *params );
265 
277  //static void projFunc( double *x, double *params, int na, double *f, double *grad, int *ind, LsqData *Data );
278 
279  void ReleaseOptimalCameraStructure();
280 
281  friend class PoseObs;
282 };
283 
284 #endif