00001
00002
00003 #ifndef CALIBRAGE_MATRICES_HPP
00004 #define CALIBRAGE_MATRICES_HPP
00005
00006 namespace jafar {
00008 namespace stereo {
00009
00015 class CalibrageMatrices {
00016 public:
00017 CalibrageMatrices();
00018 ~CalibrageMatrices(){};
00019
00020 enum STATE {NOT_INITIALIZED, INITIALIZED};
00021
00025
00026 void readFromFile(char* fileName);
00027
00028 void readFromOldFile(char* directory);
00029
00033 void saveToFile(char* fileName);
00034
00035 void readFromOldFormatFiles(int nb_lig_original,
00036 int nb_col_original,
00037 int taux_reduction_i_,
00038 int taux_reduction_j_,
00039 char* oldFilesDirectory);
00040
00044 void readFromCalibrationDir(char* projection_droite_file,
00045 char* projection_gauche_file,
00046 char* intr_droite_file,
00047 char* intr_gauche_file,
00048 char* dist_droite_file,
00049 char* dist_gauche_file);
00050
00054 void calculateRectificationBords(int nblig,
00055 int nbcol,
00056 int dist_type,
00057 int taux_reduction);
00058
00063 void estimateRectificationParams(int nblig,
00064 int nbcol,
00065 int dist_type,
00066 int taux_reduction);
00067
00068
00069
00071 CalibrageMatrices::STATE state;
00072
00073 CalibrageMatrices::STATE estimate_state;
00075 double mat_projection_droite[16];
00077 double mat_projection_gauche[16];
00078
00080 double mat_intrinseque_droite[16];
00082 double mat_distortion_droite[3];
00084 double mat_intrinseque_gauche[16];
00086 double mat_distortion_gauche[3];
00088 double mat_baseline[2];
00090 double mat_intrinseque_rectifiee_droite[16];
00092 double mat_intrinseque_rectifiee_gauche[16];
00094 double mat_rectification_droite[9];
00096 double mat_rectification_gauche[9];
00098 double mat_rect_2_cam_gauche[9];
00099
00101 int nblig;
00103 int nbcol;
00104
00105 int imin;
00106
00107 int jmin;
00108
00109 int imax;
00110
00111 int jmax;
00112
00113 int nblig_rect;
00114
00115 int nbcol_rect;
00116
00117 private:
00118 void readVectorFromFile(const char * nfichier, int nSize, double* dbVector);
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137 };
00138
00139 }
00140 }
00141
00142 #endif // CALIBRAGE_MATRICES_HPP