Go to the documentation of this file.00001 #ifndef rgrl_trans_homo2d_proj_rad_h_
00002 #define rgrl_trans_homo2d_proj_rad_h_
00003
00004
00005
00006
00007
00008
00009 #include "rgrl_transformation.h"
00010 #include <rgrl/rgrl_est_proj_rad_func.h>
00011 #include <vnl/vnl_matrix_fixed.h>
00012 #include <vcl_iosfwd.h>
00013
00014
00015
00016 class rgrl_trans_homo2d_proj_rad
00017 : public rgrl_transformation,
00018 public rgrl_est_proj_rad_func<2, 2>
00019 {
00020 vnl_matrix_fixed<double,3,3> H_;
00021 vcl_vector<double> rad_k_;
00022 public:
00023
00024 rgrl_trans_homo2d_proj_rad();
00025
00026
00027
00028 rgrl_trans_homo2d_proj_rad( vnl_matrix_fixed<double, 3, 3> const& H,
00029 vcl_vector<double> const & k,
00030 vnl_vector_fixed< double, 2 > const & image_centre );
00031
00032
00033
00034 rgrl_trans_homo2d_proj_rad( vnl_matrix<double> const& H );
00035
00036
00037
00038 rgrl_trans_homo2d_proj_rad( vnl_matrix_fixed<double, 3, 3> const& H,
00039 vcl_vector<double> const & k,
00040 vnl_vector_fixed< double, 2 > const & image_centre,
00041 vnl_matrix<double> const& covar,
00042 vnl_vector<double> const& from_centre,
00043 vnl_vector<double> const& to_centre );
00044
00045
00046
00047 rgrl_trans_homo2d_proj_rad( vcl_vector<double> const & norm_k,
00048 vnl_matrix_fixed<double, 3, 3> const& H,
00049 vnl_vector_fixed< double, 2 > const & image_centre );
00050
00051
00052
00053 rgrl_trans_homo2d_proj_rad( vcl_vector<double> const & norm_k,
00054 vnl_matrix_fixed<double, 3, 3> const& H,
00055 vnl_vector_fixed< double, 2 > const & image_centre,
00056 vnl_matrix<double> const& covar,
00057 vnl_vector<double> const& from_centre,
00058 vnl_vector<double> const& to_centre );
00059
00060 vnl_matrix<double> transfer_error_covar( vnl_vector<double> const& p ) const;
00061
00062
00063 virtual void jacobian_wrt_loc( vnl_matrix<double>& jac, vnl_vector<double> const& from_loc ) const;
00064
00065
00066 rgrl_transformation_sptr scale_by( double scale ) const;
00067
00068
00069 virtual double
00070 log_det_covar() const
00071 { return log_det_covar_deficient( 8+camera_dof_ ); }
00072
00073
00074 rgrl_type_macro( rgrl_trans_homo2d_proj_rad, rgrl_transformation );
00075
00076
00077 void write(vcl_ostream& os ) const;
00078
00079
00080 bool read(vcl_istream& is );
00081
00082
00083 rgrl_transformation_sptr clone() const;
00084
00085
00086 vnl_matrix_fixed<double, 3, 3> H() const;
00087
00088
00089 vcl_vector<double>
00090 radial_params() const;
00091
00092
00093 vcl_vector<double> const&
00094 normalized_radial_params() const
00095 { return rad_k_; }
00096
00097 protected:
00098 void map_loc( vnl_vector<double> const& from,
00099 vnl_vector<double> & to ) const;
00100
00101 void map_dir( vnl_vector<double> const& from_loc,
00102 vnl_vector<double> const& from_dir,
00103 vnl_vector<double> & to_dir ) const;
00104
00105 void set_up_rad_k(vcl_vector<double> const & rad_k);
00106 };
00107
00108 #endif // rgrl_trans_homo2d_proj_rad_h_