vgl_h_matrix_3d_compute.h
Go to the documentation of this file.
1 // This is core/vgl/algo/vgl_h_matrix_3d_compute.h
2 #ifndef vgl_h_matrix_3d_compute_h_
3 #define vgl_h_matrix_3d_compute_h_
4 //:
5 // \file
6 // \brief contains class vgl_h_matrix_3d_compute
7 // \author Ozge C. Ozcanli
8 // \date June 24, 2010
9 //
10 // Abstract interface for classes that compute projective transformations
11 // from point correspondences.
12 //
13 // \verbatim
14 // Modifications
15 // <none yet>
16 // \endverbatim
17 
18 #include <vector>
19 #ifdef _MSC_VER
20 # include <vcl_msvc_warnings.h>
21 #endif
22 #include <vgl/vgl_homg_point_3d.h>
24 
26 {
27  public:
29  virtual ~vgl_h_matrix_3d_compute() = default;
30 
31  // set this to true for verbose run-time information
32  void verbose(bool v) { verbose_ = v; }
33 
34  virtual int minimum_number_of_correspondences() const = 0;
35 
36  // Compute methods :
37  //
38  // They are implemented in terms of the pure virtual compute_ methods.
39 
40  //: homography from matched points
41  bool compute(std::vector<vgl_homg_point_3d<double> > const& points1,
42  std::vector<vgl_homg_point_3d<double> > const& points2,
44  {
45  return compute_p(points1, points2, H);
46  }
47 
48  //: homography from matched points - return h_matrix
50  compute(std::vector<vgl_homg_point_3d<double> > const& p1,
51  std::vector<vgl_homg_point_3d<double> > const& p2)
52  { vgl_h_matrix_3d<double> H; compute_p(p1, p2, H); return H; }
53 
54  protected:
55  bool verbose_;
56  virtual bool compute_p(std::vector<vgl_homg_point_3d<double> > const& points1,
57  std::vector<vgl_homg_point_3d<double> > const& points2,
59 };
60 
61 #endif // vgl_h_matrix_3d_compute_h_
virtual bool compute_p(std::vector< vgl_homg_point_3d< double > > const &points1, std::vector< vgl_homg_point_3d< double > > const &points2, vgl_h_matrix_3d< double > &H)=0
point in projective 3D space
Represents a homogeneous 3D point.
Definition: vgl_fwd.h:9
#define v
Definition: vgl_vector_2d.h:74
virtual ~vgl_h_matrix_3d_compute()=default
A class to hold a 3-d projective transformation matrix and to perform common operations using it e....
Definition: vgl_algo_fwd.h:12
virtual int minimum_number_of_correspondences() const =0
vgl_h_matrix_3d< double > compute(std::vector< vgl_homg_point_3d< double > > const &p1, std::vector< vgl_homg_point_3d< double > > const &p2)
homography from matched points - return h_matrix.
4x4 3D-to-3D projectivity
bool compute(std::vector< vgl_homg_point_3d< double > > const &points1, std::vector< vgl_homg_point_3d< double > > const &points2, vgl_h_matrix_3d< double > &H)
homography from matched points.