vgl_h_matrix_3d_compute_linear.h
Go to the documentation of this file.
1 #ifndef vgl_h_matrix_3d_compute_linear_h_
2 #define vgl_h_matrix_3d_compute_linear_h_
3 //:
4 // \file
5 // \brief contains class vgl_h_matrix_3d_compute_linear
6 // \author Ozge C. Ozcanli
7 // \date June 24, 2010
8 //
9 // vgl_h_matrix_3d_compute_linear uses the linear algorithm in point to point constructor of vgl_h_matrix_3d
10 // to calculate the homography which relates at least five 3D point correspondences.
11 // no four of them should be co-planar
12 //
13 // NOTE: the constructor of vgl_h_matrix_3d should not be used in itself as it does not standardize the point sets before
14 // constructing the design matrix (which is the matrix that is decomposed using SVD)
15 // the following class standardize the point sets and adjusts H accordingly
16 //
17 // The returned $H$ is such that
18 // $H [p_1 p_2 p_3 p_4 p_5] \sim [p'_1 p'_2 p'_3 p'_4 p_5']$
19 // where the $p_i$ are the homogeneous points in 3D, and the
20 // $p'_i$ their images.
21 //
22 // \verbatim
23 // Modifications
24 // none
25 // \endverbatim
26 
28 
30 {
31  protected:
32  //: compute from matched points
33 
34  bool compute_p(std::vector<vgl_homg_point_3d<double> > const& points1,
35  std::vector<vgl_homg_point_3d<double> > const& points2,
36  vgl_h_matrix_3d<double>& H) override;
37 
38  //:Assumes all corresponding points have equal weight
39  bool solve_linear_problem(std::vector<vgl_homg_point_3d<double> > const& p1,
40  std::vector<vgl_homg_point_3d<double> > const& p2,
42 
43  public:
45  int minimum_number_of_correspondences() const override { return 5; }
46 };
47 
48 #endif // vgl_h_matrix_3d_compute_linear_h_
contains class vgl_h_matrix_3d_compute
Represents a homogeneous 3D point.
Definition: vgl_fwd.h:9
bool solve_linear_problem(std::vector< vgl_homg_point_3d< double > > const &p1, std::vector< vgl_homg_point_3d< double > > const &p2, vgl_h_matrix_3d< double > &H)
Assumes all corresponding points have equal weight.
A class to hold a 3-d projective transformation matrix and to perform common operations using it e....
Definition: vgl_algo_fwd.h:12
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) override
compute from matched points.