00001 // This is oxl/mvl/PMatrixDecompCR.h 00002 #ifndef PMatrixDecompCR_h_ 00003 #define PMatrixDecompCR_h_ 00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE 00005 #pragma interface 00006 #endif 00007 //: 00008 // \file 00009 // \brief Decompose PMatrix into calibration + rotation 00010 // 00011 // PMatrixDecompCR decomposes a projection matrix into the form 00012 // C . Po = C . [R t] , where C is upper triangular and R is a rotation. 00013 // The diagonal elements of C are guaranteed to be nonnegative. 00014 // Moreover, if the optional second parameter of the constructor 00015 // is not set to "false", the matrix C is scaled so that C(2,2) = 1. 00016 // 00017 // \author 00018 // Andrew W. Fitzgibbon, Oxford RRG, 08 Jun 98 00019 // 00020 // \verbatim 00021 // Modifications: 00022 // 14-Nov-02, Peter Vanroose - make sure C(1,1) is nonnegative 00023 // \endverbatim 00024 //----------------------------------------------------------------------------- 00025 00026 #include <vnl/vnl_double_3x3.h> 00027 #include <vnl/vnl_double_3x4.h> 00028 class PMatrix; 00029 00030 struct PMatrixDecompCR 00031 { 00032 vnl_double_3x3 C; 00033 vnl_double_3x4 Po; 00034 00035 PMatrixDecompCR(PMatrix const& P, bool scale_C = true); 00036 private: 00037 PMatrixDecompCR(vnl_double_3x4 const& P_3x4, bool scale_C); 00038 void compute(vnl_double_3x4 const& P_3x4, bool scale_C); 00039 }; 00040 00041 #endif // PMatrixDecompCR_h_