vgl_h_matrix_2d_compute_4point.h
Go to the documentation of this file.
1 // This is core/vgl/algo/vgl_h_matrix_2d_compute_4point.h
2 #ifndef vgl_h_matrix_2d_compute_4point_h_
3 #define vgl_h_matrix_2d_compute_4point_h_
4 //--------------------------------------------------------------
5 //:
6 // \file
7 //
8 // vgl_h_matrix_2d_compute_linear contains a linear method to calculate
9 // the plane projectivity which relates four 2D point correspondences.
10 // The returned $H$ is such that
11 // $H ~ [p_1 ~ p_2 ~ p_3 ~ p_4 ] \sim [p'_1 ~ p'_2 ~ p'_3 ~ p'_4 ]$
12 // where the $p_i$ are the homogeneous points in the first view, and the
13 // $p'_i$ their images.
14 //
15 // \verbatim
16 // Modifications
17 // 08-02-98 FSM obsoleted bool compute(vgl_h_matrix_2d<double> *)
18 // Mar 26, 2003 JLM Preparing to move up to vgl
19 // Jun 23, 2003 Peter Vanroose - made compute_pl() etc. pure virtual
20 // Jun 23, 2003 Peter Vanroose - added rough first impl. for compute_l()
21 // \endverbatim
22 
24 
26 {
27  public:
28  int minimum_number_of_correspondences() const override { return 4; }
29 
30  protected:
31  //: compute from matched points
32 
33  bool compute_p(std::vector<vgl_homg_point_2d<double> > const& points1,
34  std::vector<vgl_homg_point_2d<double> > const& points2,
35  vgl_h_matrix_2d<double>& H) override;
36 
37  //:compute from matched lines
38 
39  bool compute_l(std::vector<vgl_homg_line_2d<double> > const& lines1,
40  std::vector<vgl_homg_line_2d<double> > const& lines2,
41  vgl_h_matrix_2d<double>& H) override;
42 
43  //:compute from matched lines with weight vector
44 
45  bool compute_l(std::vector<vgl_homg_line_2d<double> > const& lines1,
46  std::vector<vgl_homg_line_2d<double> > const& lines2,
47  std::vector<double> const& weights,
48  vgl_h_matrix_2d<double>& H) override;
49 
50  //:compute from matched points and lines
51 
52  bool compute_pl(std::vector<vgl_homg_point_2d<double> > const& points1,
53  std::vector<vgl_homg_point_2d<double> > const& points2,
54  std::vector<vgl_homg_line_2d<double> > const& lines1,
55  std::vector<vgl_homg_line_2d<double> > const& lines2,
56  vgl_h_matrix_2d<double>& H) override;
57 };
58 
59 #endif // vgl_h_matrix_2d_compute_4point_h_
Represents a homogeneous 2D line.
Definition: vgl_fwd.h:14
bool compute_pl(std::vector< vgl_homg_point_2d< double > > const &points1, std::vector< vgl_homg_point_2d< double > > const &points2, std::vector< vgl_homg_line_2d< double > > const &lines1, std::vector< vgl_homg_line_2d< double > > const &lines2, vgl_h_matrix_2d< double > &H) override
compute from matched points and lines.
bool compute_l(std::vector< vgl_homg_line_2d< double > > const &lines1, std::vector< vgl_homg_line_2d< double > > const &lines2, vgl_h_matrix_2d< double > &H) override
compute from matched lines.
bool compute_p(std::vector< vgl_homg_point_2d< double > > const &points1, std::vector< vgl_homg_point_2d< double > > const &points2, vgl_h_matrix_2d< double > &H) override
compute from matched points.
contains class vgl_h_matrix_2d_compute
Represents a homogeneous 2D point.
Definition: vgl_fwd.h:8