core/vgl/algo/vgl_h_matrix_3d_compute.h
Go to the documentation of this file.
00001 // This is core/vgl/algo/vgl_h_matrix_3d_compute.h
00002 #ifndef vgl_h_matrix_3d_compute_h_
00003 #define vgl_h_matrix_3d_compute_h_
00004 //:
00005 // \file
00006 // \brief contains class vgl_h_matrix_3d_compute
00007 // \author Ozge C. Ozcanli
00008 // \date June 24, 2010
00009 //
00010 // Abstract interface for classes that compute projective transformations
00011 // from point correspondences.
00012 //
00013 // \verbatim
00014 //  Modifications
00015 //   <none yet>
00016 // \endverbatim
00017 
00018 #include <vcl_vector.h>
00019 #include <vgl/vgl_homg_point_3d.h>
00020 #include <vgl/algo/vgl_h_matrix_3d.h>
00021 
00022 class vgl_h_matrix_3d_compute
00023 {
00024  public:
00025   vgl_h_matrix_3d_compute() : verbose_(false) {}
00026   virtual ~vgl_h_matrix_3d_compute() {}
00027 
00028   // set this to true for verbose run-time information
00029   void verbose(bool v) { verbose_ = v; }
00030 
00031   virtual int minimum_number_of_correspondences() const = 0;
00032 
00033   // Compute methods :
00034   //
00035   // They are implemented in terms of the pure virtual compute_ methods.
00036 
00037   //: homography from matched points
00038   bool compute(vcl_vector<vgl_homg_point_3d<double> > const& points1,
00039                vcl_vector<vgl_homg_point_3d<double> > const& points2,
00040                vgl_h_matrix_3d<double>& H)
00041   {
00042     return compute_p(points1, points2, H);
00043   }
00044 
00045   //: homography from matched points - return h_matrix
00046   vgl_h_matrix_3d<double>
00047   compute(vcl_vector<vgl_homg_point_3d<double> > const& p1,
00048           vcl_vector<vgl_homg_point_3d<double> > const& p2)
00049   { vgl_h_matrix_3d<double> H; compute_p(p1, p2, H); return H; }
00050 
00051  protected:
00052   bool verbose_;
00053   virtual bool compute_p(vcl_vector<vgl_homg_point_3d<double> > const& points1,
00054                          vcl_vector<vgl_homg_point_3d<double> > const& points2,
00055                          vgl_h_matrix_3d<double>& H) = 0;
00056 };
00057 
00058 #endif // vgl_h_matrix_3d_compute_h_