core/vgl/algo/vgl_h_matrix_2d_compute_4point.h
Go to the documentation of this file.
00001 // This is core/vgl/algo/vgl_h_matrix_2d_compute_4point.h
00002 #ifndef vgl_h_matrix_2d_compute_4point_h_
00003 #define vgl_h_matrix_2d_compute_4point_h_
00004 //--------------------------------------------------------------
00005 //:
00006 // \file
00007 //
00008 // vgl_h_matrix_2d_compute_linear contains a linear method to calculate
00009 // the plane projectivity which relates four 2D point correspondences.
00010 // The returned $H$ is such that
00011 // $H ~ [p_1 ~ p_2 ~ p_3 ~ p_4 ] \sim [p'_1 ~ p'_2 ~ p'_3 ~ p'_4 ]$
00012 // where the $p_i$ are the homogeneous points in the first view, and the
00013 // $p'_i$ their images.
00014 //
00015 // \verbatim
00016 //  Modifications
00017 //   08-02-98 FSM obsoleted bool compute(vgl_h_matrix_2d<double>  *)
00018 //   Mar 26, 2003 JLM Preparing to move up to vgl
00019 //   Jun 23, 2003 Peter Vanroose - made compute_pl() etc. pure virtual
00020 //   Jun 23, 2003 Peter Vanroose - added rough first impl. for compute_l()
00021 // \endverbatim
00022 
00023 #include <vgl/algo/vgl_h_matrix_2d_compute.h>
00024 
00025 class vgl_h_matrix_2d_compute_4point : public vgl_h_matrix_2d_compute
00026 {
00027  public:
00028   int minimum_number_of_correspondences() const { return 4; }
00029 
00030  protected:
00031   //: compute from matched points
00032   virtual
00033   bool compute_p(vcl_vector<vgl_homg_point_2d<double> > const& points1,
00034                  vcl_vector<vgl_homg_point_2d<double> > const& points2,
00035                  vgl_h_matrix_2d<double>& H);
00036 
00037   //:compute from matched lines
00038   virtual
00039   bool compute_l(vcl_vector<vgl_homg_line_2d<double> > const& lines1,
00040                  vcl_vector<vgl_homg_line_2d<double> > const& lines2,
00041                  vgl_h_matrix_2d<double>& H);
00042 
00043   //:compute from matched lines with weight vector
00044   virtual
00045   bool compute_l(vcl_vector<vgl_homg_line_2d<double> > const& lines1,
00046                  vcl_vector<vgl_homg_line_2d<double> > const& lines2,
00047                  vcl_vector<double> const& weights,
00048                  vgl_h_matrix_2d<double>& H);
00049 
00050   //:compute from matched points and lines
00051   virtual
00052   bool compute_pl(vcl_vector<vgl_homg_point_2d<double> > const& points1,
00053                   vcl_vector<vgl_homg_point_2d<double> > const& points2,
00054                   vcl_vector<vgl_homg_line_2d<double> > const& lines1,
00055                   vcl_vector<vgl_homg_line_2d<double> > const& lines2,
00056                   vgl_h_matrix_2d<double>& H);
00057 };
00058 
00059 #endif // vgl_h_matrix_2d_compute_4point_h_