contrib/oxl/mvl/HMatrix2DCompute.h
Go to the documentation of this file.
00001 #ifndef HMatrix2DCompute_h_
00002 #define HMatrix2DCompute_h_
00003 //:
00004 // \file
00005 //
00006 // Abstract interface for classes that compute plane-to-plane
00007 // projectivities from point and line correspondences.
00008 //
00009 // \verbatim
00010 // Modifications:
00011 //   08-02-98 FSM
00012 //      1. Added virtual compute methods that actually take arguments :
00013 //         generic estimator using points, lines or both.
00014 //      2. Obsoleted bool compute(HMatrix2D *). So don't use it!
00015 //      3. made arguments to compute method 'const ... &',
00016 //         thereby potentially breaking the code of certain other people.
00017 // \endverbatim
00018 
00019 class HMatrix2D;
00020 class PairMatchSetCorner;
00021 #include <mvl/HomgPoint2D.h>
00022 #include <mvl/HomgLine2D.h>
00023 #include <vcl_vector.h>
00024 
00025 class HMatrix2DCompute {
00026 public:
00027   HMatrix2DCompute() : verbose_(false) { }
00028   virtual ~HMatrix2DCompute() { }
00029 
00030   // set this to true for verbose run-time information
00031   void verbose(bool v) { verbose_ = v; }
00032 
00033   // fsm
00034   virtual int minimum_number_of_correspondences() const = 0;
00035 
00036   // these reduce the size of the method signatures somewhat.
00037   typedef vcl_vector<HomgPoint2D> PointArray;
00038   typedef vcl_vector<HomgLine2D>  LineArray;
00039 
00040   // Compute methods :
00041   //
00042   // Some use point correspondences, some use line
00043   // correspondences, some use both. They are implemented
00044   // in terms of the compute_(p|l|pl) methods.
00045 
00046   bool compute(PointArray const&, PointArray const&, HMatrix2D *);
00047   bool compute(LineArray const&, LineArray const&, HMatrix2D *);
00048   bool compute(PointArray const&, PointArray const&, LineArray const&, LineArray const&, HMatrix2D *);
00049   bool compute(PairMatchSetCorner const &, HMatrix2D *);
00050 
00051   HMatrix2D compute(PointArray const&, PointArray const&);
00052   HMatrix2D compute(LineArray const&, LineArray const&);
00053   HMatrix2D compute(PointArray const&, PointArray const&, LineArray const&, LineArray const&);
00054   HMatrix2D compute(PairMatchSetCorner const &);
00055 
00056 protected:
00057   bool verbose_;
00058 
00059   virtual bool compute_p (PointArray const&, PointArray const&, HMatrix2D *);
00060   virtual bool compute_l (LineArray const&, LineArray const&, HMatrix2D *);
00061   virtual bool compute_pl(PointArray const&, PointArray const&, LineArray const&, LineArray const&, HMatrix2D *);
00062 };
00063 
00064 #endif // HMatrix2DCompute_h_