00001
00002 #ifndef vgl_h_matrix_2d_compute_h_
00003 #define vgl_h_matrix_2d_compute_h_
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include <vcl_vector.h>
00026 #include <vgl/vgl_homg_point_2d.h>
00027 #include <vgl/vgl_homg_line_2d.h>
00028 #include <vgl/algo/vgl_h_matrix_2d.h>
00029
00030 class vgl_h_matrix_2d_compute
00031 {
00032 public:
00033 vgl_h_matrix_2d_compute() : verbose_(false) {}
00034 virtual ~vgl_h_matrix_2d_compute() {}
00035
00036
00037 void verbose(bool v) { verbose_ = v; }
00038
00039
00040 virtual int minimum_number_of_correspondences() const = 0;
00041
00042
00043
00044
00045
00046
00047
00048
00049 bool compute(vcl_vector<vgl_homg_point_2d<double> > const& points1,
00050 vcl_vector<vgl_homg_point_2d<double> > const& points2,
00051 vgl_h_matrix_2d<double>& H)
00052 {
00053 return compute_p(points1, points2, H);
00054 }
00055
00056
00057 bool compute(vcl_vector<vgl_homg_line_2d<double> > const& lines1,
00058 vcl_vector<vgl_homg_line_2d<double> > const& lines2,
00059 vgl_h_matrix_2d<double>& H)
00060 {
00061 return compute_l(lines1, lines2, H);
00062 }
00063
00064
00065 bool compute(vcl_vector<vgl_homg_line_2d<double> > const& lines1,
00066 vcl_vector<vgl_homg_line_2d<double> > const& lines2,
00067 vcl_vector<double> const& weights,
00068 vgl_h_matrix_2d<double>& H)
00069 {
00070 return compute_l(lines1, lines2, weights, H);
00071 }
00072
00073
00074 bool compute(vcl_vector<vgl_homg_point_2d<double> > const& points1,
00075 vcl_vector<vgl_homg_point_2d<double> > const& points2,
00076 vcl_vector<vgl_homg_line_2d<double> > const& lines1,
00077 vcl_vector<vgl_homg_line_2d<double> > const& lines2,
00078 vgl_h_matrix_2d<double>& H)
00079 {
00080 return compute_pl(points1, points2, lines1, lines2, H);
00081 }
00082
00083
00084 vgl_h_matrix_2d<double>
00085 compute(vcl_vector<vgl_homg_point_2d<double> > const& p1,
00086 vcl_vector<vgl_homg_point_2d<double> > const& p2)
00087 { vgl_h_matrix_2d<double> H; compute_p(p1, p2, H); return H; }
00088
00089
00090 vgl_h_matrix_2d<double>
00091 compute(vcl_vector<vgl_homg_line_2d<double> > const& l1,
00092 vcl_vector<vgl_homg_line_2d<double> > const& l2)
00093 { vgl_h_matrix_2d<double> H; compute_l(l1, l2, H); return H; }
00094
00095
00096 vgl_h_matrix_2d<double>
00097 compute(vcl_vector<vgl_homg_line_2d<double> > const& l1,
00098 vcl_vector<vgl_homg_line_2d<double> > const& l2,
00099 vcl_vector<double> const& weights)
00100 { vgl_h_matrix_2d<double> H; compute_l(l1, l2, weights, H); return H; }
00101
00102
00103 vgl_h_matrix_2d<double>
00104 compute(vcl_vector<vgl_homg_point_2d<double> > const& p1,
00105 vcl_vector<vgl_homg_point_2d<double> > const& p2,
00106 vcl_vector<vgl_homg_line_2d<double> > const& l1,
00107 vcl_vector<vgl_homg_line_2d<double> > const& l2)
00108 { vgl_h_matrix_2d<double> H; compute_pl(p1, p2, l1, l2, H); return H; }
00109
00110 protected:
00111 bool verbose_;
00112 virtual bool compute_p(vcl_vector<vgl_homg_point_2d<double> > const& points1,
00113 vcl_vector<vgl_homg_point_2d<double> > const& points2,
00114 vgl_h_matrix_2d<double>& H) = 0;
00115
00116 virtual bool compute_l(vcl_vector<vgl_homg_line_2d<double> > const& lines1,
00117 vcl_vector<vgl_homg_line_2d<double> > const& lines2,
00118 vgl_h_matrix_2d<double>& H) = 0;
00119
00120 virtual bool compute_l(vcl_vector<vgl_homg_line_2d<double> > const& lines1,
00121 vcl_vector<vgl_homg_line_2d<double> > const& lines2,
00122 vcl_vector<double> const& weights,
00123 vgl_h_matrix_2d<double>& H) = 0;
00124
00125 virtual bool compute_pl(vcl_vector<vgl_homg_point_2d<double> > const& points1,
00126 vcl_vector<vgl_homg_point_2d<double> > const& points2,
00127 vcl_vector<vgl_homg_line_2d<double> > const& lines1,
00128 vcl_vector<vgl_homg_line_2d<double> > const& lines2,
00129 vgl_h_matrix_2d<double>& H) = 0;
00130 };
00131
00132 #endif // vgl_h_matrix_2d_compute_h_