core/vgl/algo/vgl_h_matrix_2d_compute_rigid_body.h
Go to the documentation of this file.
00001 #ifndef vgl_h_matrix_2d_compute_rigid_body_h_
00002 #define vgl_h_matrix_2d_compute_rigid_body_h_
00003 //:
00004 // \file
00005 // \brief contains class vgl_h_matrix_2d_compute_rigid_body
00006 // \author Joseph Mundy
00007 // \date August 4, 2007
00008 // vgl_h_matrix_2d_compute_rigid_body computes the rigid body transformation
00009 // between points or lines
00010 // \verbatim
00011 //  Modifications
00012 // none
00013 // \endverbatim
00014 
00015 #include <vgl/algo/vgl_h_matrix_2d_compute.h>
00016 
00017 class vgl_h_matrix_2d_compute_rigid_body : public vgl_h_matrix_2d_compute
00018 {
00019  protected:
00020   //: compute from matched points
00021   virtual
00022   bool compute_p(vcl_vector<vgl_homg_point_2d<double> > const& points1,
00023                  vcl_vector<vgl_homg_point_2d<double> > const& points2,
00024                  vgl_h_matrix_2d<double>& H);
00025 
00026   //:compute from matched lines
00027   virtual
00028   bool compute_l(vcl_vector<vgl_homg_line_2d<double> > const& lines1,
00029                  vcl_vector<vgl_homg_line_2d<double> > const& lines2,
00030                  vgl_h_matrix_2d<double>& H);
00031 
00032   //:compute from matched lines with weight vector (not implemented)
00033   virtual
00034   bool compute_l(vcl_vector<vgl_homg_line_2d<double> > const& lines1,
00035                  vcl_vector<vgl_homg_line_2d<double> > const& lines2,
00036                  vcl_vector<double> const& weights,
00037                  vgl_h_matrix_2d<double>& H);
00038 
00039   //:compute from matched points and lines
00040   virtual
00041   bool compute_pl(vcl_vector<vgl_homg_point_2d<double> > const& points1,
00042                   vcl_vector<vgl_homg_point_2d<double> > const& points2,
00043                   vcl_vector<vgl_homg_line_2d<double> > const& lines1,
00044                   vcl_vector<vgl_homg_line_2d<double> > const& lines2,
00045                   vgl_h_matrix_2d<double>& H);
00046   //:Assumes all corresponding points have equal weight
00047   bool solve_rigid_body_problem(int equ_count,
00048                                 vcl_vector<vgl_homg_point_2d<double> >const& p1,
00049                                 vcl_vector<vgl_homg_point_2d<double> >const& p2,
00050                                 vgl_h_matrix_2d<double>& H);
00051 
00052 
00053  public:
00054   vgl_h_matrix_2d_compute_rigid_body();
00055   int minimum_number_of_correspondences() const { return 2; }
00056 };
00057 
00058 #endif // vgl_h_matrix_2d_compute_rigid_body_h_