1 #ifndef vgl_h_matrix_3d_compute_affine_h_ 2 #define vgl_h_matrix_3d_compute_affine_h_ 3 //: 4 // \file 5 // \brief contains class vgl_h_matrix_3d_compute_affine 6 // \author J.L. Mundy 7 // \date Sept. 7, 2015 8 // 9 // vgl_h_matrix_3d_compute_affine requires at least four 3-d point correspondences 10 // 11 // \verbatim 12 // Modifications 13 // none 14 // \endverbatim 15 16 #include <vgl/algo/vgl_h_matrix_3d_compute.h> 17 #include <vnl/vnl_matrix.h> 18 class vgl_h_matrix_3d_compute_affine : public vgl_h_matrix_3d_compute 19 { 20 protected: 21 //: compute from matched points 22 23 bool compute_p(std::vector<vgl_homg_point_3d<double> > const& points1, 24 std::vector<vgl_homg_point_3d<double> > const& points2, 25 vgl_h_matrix_3d<double>& H) override; 26 27 //:Assumes all corresponding points have equal weight 28 bool solve_linear_problem(std::vector<vgl_homg_point_3d<double> > const& p1, 29 std::vector<vgl_homg_point_3d<double> > const& p2, 30 vnl_matrix<double>& M); 31 32 33 public: 34 vgl_h_matrix_3d_compute_affine() = default; minimum_number_of_correspondences()35 int minimum_number_of_correspondences() const override { return 4; } 36 }; 37 38 #endif // vgl_h_matrix_3d_compute_affine_h_ 39