contrib/oxl/mvl/FMatrixPlanar.h
Go to the documentation of this file.
00001 // This is oxl/mvl/FMatrixPlanar.h
00002 #ifndef FMatrixPlanar_h_
00003 #define FMatrixPlanar_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 
00008 //--------------------------------------------------------------
00009 //:
00010 // \file
00011 // \brief planar fundamental matrix
00012 //
00013 // A class to hold a Fundamental Matrix of the planar form
00014 // which occurs when the translation is confined to the plane
00015 // perpendicular to the rotation axis.
00016 // Some common operations e.g. generate epipolar lines,
00017 // are inherited from the class FMatrix.
00018 //
00019 // \verbatim
00020 // Modifications
00021 //    22 Oct 2002 - Peter Vanroose - added vgl_homg_point_2d interface
00022 // \endverbatim
00023 //
00024 
00025 #include <vnl/vnl_double_3x3.h>
00026 #include <mvl/HomgPoint2D.h>
00027 #include <vgl/vgl_homg_point_2d.h>
00028 #include <mvl/FMatrix.h>
00029 
00030 class FMatrixPlanar : public FMatrix
00031 {
00032  public:
00033   FMatrixPlanar();
00034   FMatrixPlanar(const double* f_matrix);
00035   FMatrixPlanar(const vnl_double_3x3& f_matrix);
00036   ~FMatrixPlanar();
00037 
00038   // Computations-----------------------------------------------------------
00039   void init(const FMatrix& F);
00040 
00041   //: Null function since planar FMatrix has already rank 2.
00042   inline void set_rank2_using_svd() {}
00043   //: Returns current matrix which is already Rank 2.
00044   inline FMatrixPlanar get_rank2_truncated() { return *this; }
00045   void find_nearest_perfect_match (const HomgPoint2D& in1, const HomgPoint2D& in2,
00046                                    HomgPoint2D *out1, HomgPoint2D *out2) const;
00047   void find_nearest_perfect_match (vgl_homg_point_2d<double> const& in1,
00048                                    vgl_homg_point_2d<double> const& in2,
00049                                    vgl_homg_point_2d<double>& out1,
00050                                    vgl_homg_point_2d<double>& out2) const;
00051 
00052   // Data Access------------------------------------------------------------
00053 
00054   bool set (const double* f_matrix );
00055   bool set (const vnl_double_3x3& f_matrix );
00056   //: Returns the rank2 flag which is always true for FMatrixPlanar.
00057   inline bool get_rank2_flag (void) const { return true; }
00058   //: Null function since planar FMatrix has already rank 2.
00059   inline void set_rank2_flag (bool /*rank2_flag*/) const {}
00060 };
00061 
00062 #endif // FMatrixPlanar_h_