Go to the documentation of this file.00001 #ifndef rgrl_trans_rad_dis_homo2d_h_
00002 #define rgrl_trans_rad_dis_homo2d_h_
00003
00004
00005
00006
00007
00008 #include "rgrl_transformation.h"
00009 #include <vnl/vnl_matrix_fixed.h>
00010 #include <vnl/vnl_vector_fixed.h>
00011 #include <vcl_iosfwd.h>
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 class rgrl_trans_rad_dis_homo2d
00026 : public rgrl_transformation
00027 {
00028 public:
00029
00030 rgrl_trans_rad_dis_homo2d();
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 rgrl_trans_rad_dis_homo2d( vnl_matrix<double> const& H,
00043 double k1_from,
00044 double k1_to,
00045 vnl_vector<double> const& from_centre,
00046 vnl_vector<double> const& to_centre );
00047
00048
00049
00050 rgrl_trans_rad_dis_homo2d( vnl_matrix<double> const& H,
00051 double k1_from,
00052 double k1_to,
00053 vnl_matrix<double> const& covar,
00054 vnl_vector<double> const& from_centre,
00055 vnl_vector<double> const& to_centre );
00056
00057 vnl_matrix<double> transfer_error_covar( vnl_vector<double> const& p ) const;
00058
00059
00060 double k1_from() const { return k1_from_; }
00061
00062
00063 double k1_to() const { return k1_to_; }
00064
00065
00066 vnl_vector<double> from_centre() const { return from_centre_.as_ref(); }
00067
00068
00069 vnl_vector<double> to_centre() const { return to_centre_.as_ref(); }
00070
00071
00072 void inv_map( const vnl_vector<double>& to,
00073 vnl_vector<double>& from ) const;
00074
00075
00076 bool is_invertible() const { return false; }
00077
00078
00079 rgrl_transformation_sptr inverse_transform() const;
00080
00081
00082 virtual void jacobian_wrt_loc( vnl_matrix<double>& jac, vnl_vector<double> const& from_loc ) const;
00083
00084
00085 rgrl_transformation_sptr scale_by( double scale ) const;
00086
00087
00088 vnl_matrix_fixed<double, 3, 3> const& H() const { return H_; }
00089
00090
00091 vnl_matrix_fixed<double, 3, 3>
00092 uncenter_H_matrix( ) const;
00093
00094
00095 virtual double
00096 log_det_covar() const
00097 { return log_det_covar_deficient( 10 ); }
00098
00099
00100 rgrl_type_macro( rgrl_trans_rad_dis_homo2d, rgrl_transformation );
00101
00102
00103 void write(vcl_ostream& os ) const;
00104
00105
00106 bool read(vcl_istream& is );
00107
00108
00109 rgrl_transformation_sptr clone() const;
00110
00111 protected:
00112 void map_loc( vnl_vector<double> const& from,
00113 vnl_vector<double> & to ) const;
00114
00115 void map_dir( vnl_vector<double> const& from_loc,
00116 vnl_vector<double> const& from_dir,
00117 vnl_vector<double> & to_dir ) const;
00118
00119 private:
00120 vnl_matrix_fixed<double, 3, 3> H_;
00121 vnl_vector_fixed<double, 2> from_centre_;
00122 vnl_vector_fixed<double, 2> to_centre_;
00123
00124 double k1_from_;
00125 double k1_to_;
00126 };
00127
00128 #endif