contrib/oxl/mvl/FMatrixSkew.h
Go to the documentation of this file.
00001 // This is oxl/mvl/FMatrixSkew.h
00002 #ifndef FMatrixSkew_h_
00003 #define FMatrixSkew_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //--------------------------------------------------------------
00008 //:
00009 // \file
00010 // \brief Skew fundamental matrix
00011 //
00012 // A class to hold a Fundamental Matrix of the skew form
00013 // which occurs with a pure translational motion.
00014 // Some common operations e.g. generate epipolar lines,
00015 // are inherited from the class FMatrix.
00016 //
00017 // \verbatim
00018 // Modifications
00019 //    22 Oct 2002 - Peter Vanroose - added vgl_homg_point_2d interface
00020 // \endverbatim
00021 
00022 #include <vnl/vnl_matrix.h>
00023 #include <mvl/HomgPoint2D.h>
00024 #include <vgl/vgl_homg_point_2d.h>
00025 #include <mvl/FMatrix.h>
00026 
00027 class FMatrixSkew : public FMatrix
00028 {
00029  public:
00030 
00031   // Constructors/Initializers/Destructors----------------------------------
00032 
00033   FMatrixSkew();
00034   FMatrixSkew(const double* f_matrix);
00035   FMatrixSkew(const vnl_matrix<double>& f_matrix);
00036   ~FMatrixSkew();
00037 
00038   // Computations
00039 
00040   inline void set_rank2_using_svd();
00041   inline FMatrixSkew get_rank2_truncated();
00042   bool get_epipoles (HomgPoint2D *e1_out, HomgPoint2D *e2_out) const;
00043   bool get_epipoles (vgl_homg_point_2d<double>& e1_out,
00044                      vgl_homg_point_2d<double>& e2_out) const;
00045   void decompose_to_skew_rank3 (vnl_matrix<double> *skew,
00046                                 vnl_matrix<double> *rank3) const;
00047   void find_nearest_perfect_match (const HomgPoint2D& in1, const HomgPoint2D& in2,
00048                                    HomgPoint2D *out1, HomgPoint2D *out2) const;
00049   void find_nearest_perfect_match (vgl_homg_point_2d<double> const& in1,
00050                                    vgl_homg_point_2d<double> const& in2,
00051                                    vgl_homg_point_2d<double>& out1,
00052                                    vgl_homg_point_2d<double>& out2) const;
00053 
00054   // Data Access------------------------------------------------------------
00055 
00056   bool set (const double* f_matrix );
00057   inline bool set (const vnl_matrix<double>& f_matrix );
00058   inline bool get_rank2_flag (void) const;
00059   inline void set_rank2_flag (bool rank2_flag);
00060 };
00061 
00062 #endif // FMatrixSkew_h_