00001 #ifndef rgrl_est_dis_homo2d_lm_h_ 00002 #define rgrl_est_dis_homo2d_lm_h_ 00003 00004 //: 00005 // \file 00006 // \author Gehua Yang 00007 // \date Feb 2005 00008 00009 #include <rgrl/rgrl_estimator.h> 00010 #include <vnl/vnl_double_2.h> 00011 00012 //: homography2D transform estimator 00013 // 00014 // NOTE: 00015 // 1. assume error projector has all eigen-values as one 00016 // 00017 class rgrl_est_dis_homo2d_lm 00018 : public rgrl_nonlinear_estimator 00019 { 00020 public: 00021 //: Default constructor 00022 // 00023 rgrl_est_dis_homo2d_lm( vnl_vector<double> const& from_centre, 00024 vnl_vector<double> const& to_centre, 00025 bool with_grad = true ); 00026 00027 //: Estimates homography transformation 00028 // 00029 // \sa rgrl_estimator::estimate 00030 // 00031 rgrl_transformation_sptr 00032 estimate( rgrl_set_of<rgrl_match_set_sptr> const& matches, 00033 rgrl_transformation const& cur_transform ) const; 00034 00035 //: Estimates homography transformation w/ radial lens distortion 00036 // 00037 // \sa rgrl_estimator::estimate 00038 // 00039 rgrl_transformation_sptr 00040 estimate( rgrl_match_set_sptr matches, 00041 rgrl_transformation const& cur_transform ) const; 00042 00043 //: Type of transformation estimated by this estimator. 00044 const vcl_type_info& transformation_type() const; 00045 00046 // Defines type-related functions 00047 rgrl_type_macro( rgrl_est_dis_homo2d_lm, rgrl_nonlinear_estimator ); 00048 00049 //: change frome_centre 00050 void set_centres( vnl_vector<double> const& from_centre, 00051 vnl_vector<double> const& to_centre ); 00052 00053 //: to use analytical gradients or not 00054 void use_gradient( bool use_grad ) 00055 { with_grad_ = use_grad; } 00056 00057 private: 00058 00059 vnl_double_2 from_centre_, to_centre_; 00060 00061 bool with_grad_; 00062 }; 00063 00064 #endif