Go to the documentation of this file.00001
00002 #include "vgl_h_matrix_2d_compute_4point.h"
00003
00004
00005 #include <vnl/vnl_inverse.h>
00006 #include <vcl_cassert.h>
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 bool vgl_h_matrix_2d_compute_4point::compute_p(vcl_vector<vgl_homg_point_2d<double> > const& points1,
00018 vcl_vector<vgl_homg_point_2d<double> > const& points2,
00019 vgl_h_matrix_2d<double>& H)
00020 {
00021 vgl_h_matrix_2d<double> H1, H2;
00022 if (!H1.projective_basis(points1))
00023 return false;
00024 if (!H2.projective_basis(points2))
00025 return false;
00026 H.set(vnl_inverse(H2.get_matrix()) * H1.get_matrix());
00027 return true;
00028 }
00029
00030
00031
00032
00033
00034
00035
00036
00037 bool vgl_h_matrix_2d_compute_4point::compute_l(vcl_vector<vgl_homg_line_2d<double> > const& lines1,
00038 vcl_vector<vgl_homg_line_2d<double> > const& lines2,
00039 vgl_h_matrix_2d<double>& H)
00040 {
00041 vgl_h_matrix_2d<double> H1, H2;
00042 if (!H1.projective_basis(lines1))
00043 return false;
00044 if (!H2.projective_basis(lines2))
00045 return false;
00046 H.set(vnl_inverse(H2.get_matrix()) * H1.get_matrix());
00047 return true;
00048 }
00049
00050 bool vgl_h_matrix_2d_compute_4point::compute_l(vcl_vector<vgl_homg_line_2d<double> > const& lines1,
00051 vcl_vector<vgl_homg_line_2d<double> > const& lines2,
00052 vcl_vector<double> const&,
00053 vgl_h_matrix_2d<double>& H)
00054 {
00055 vgl_h_matrix_2d<double> H1, H2;
00056 if (!H1.projective_basis(lines1))
00057 return false;
00058 if (!H2.projective_basis(lines2))
00059 return false;
00060 H.set(vnl_inverse(H2.get_matrix()) * H1.get_matrix());
00061 return true;
00062 }
00063
00064 bool vgl_h_matrix_2d_compute_4point::compute_pl(vcl_vector<vgl_homg_point_2d<double> > const& ,
00065 vcl_vector<vgl_homg_point_2d<double> > const& ,
00066 vcl_vector<vgl_homg_line_2d<double> > const& ,
00067 vcl_vector<vgl_homg_line_2d<double> > const& ,
00068 vgl_h_matrix_2d<double>& )
00069 {
00070 assert(!"vgl_h_matrix_2d_compute_4point::compute_pl() NYI");
00071 return false;
00072 }