1 // This is oxl/mvl/FMatrixSkew.h 2 #ifndef FMatrixSkew_h_ 3 #define FMatrixSkew_h_ 4 //-------------------------------------------------------------- 5 //: 6 // \file 7 // \brief Skew fundamental matrix 8 // 9 // A class to hold a Fundamental Matrix of the skew form 10 // which occurs with a pure translational motion. 11 // Some common operations e.g. generate epipolar lines, 12 // are inherited from the class FMatrix. 13 // 14 // \verbatim 15 // Modifications 16 // 22 Oct 2002 - Peter Vanroose - added vgl_homg_point_2d interface 17 // \endverbatim 18 19 #include <vnl/vnl_matrix.h> 20 #include <mvl/HomgPoint2D.h> 21 #include <vgl/vgl_homg_point_2d.h> 22 #include <mvl/FMatrix.h> 23 24 class FMatrixSkew : public FMatrix 25 { 26 public: 27 28 // Constructors/Initializers/Destructors---------------------------------- 29 30 FMatrixSkew(); 31 FMatrixSkew(const double* f_matrix); 32 FMatrixSkew(const vnl_matrix<double>& f_matrix); 33 ~FMatrixSkew() override; 34 35 // Computations 36 37 inline void set_rank2_using_svd(); 38 inline FMatrixSkew get_rank2_truncated(); 39 bool get_epipoles (HomgPoint2D *e1_out, HomgPoint2D *e2_out) const; 40 bool get_epipoles (vgl_homg_point_2d<double>& e1_out, 41 vgl_homg_point_2d<double>& e2_out) const; 42 void decompose_to_skew_rank3 (vnl_matrix<double> *skew, 43 vnl_matrix<double> *rank3) const; 44 void find_nearest_perfect_match (const HomgPoint2D& in1, const HomgPoint2D& in2, 45 HomgPoint2D *out1, HomgPoint2D *out2) const; 46 void find_nearest_perfect_match (vgl_homg_point_2d<double> const& in1, 47 vgl_homg_point_2d<double> const& in2, 48 vgl_homg_point_2d<double>& out1, 49 vgl_homg_point_2d<double>& out2) const; 50 51 // Data Access------------------------------------------------------------ 52 53 bool set (const double* f_matrix ) override; 54 bool set (const vnl_matrix<double>& f_matrix ); 55 bool get_rank2_flag() const; 56 void set_rank2_flag (bool rank2_flag); 57 }; 58 59 #endif // FMatrixSkew_h_ 60