Go to the documentation of this file.00001 #ifndef rgrl_trans_affine_h_
00002 #define rgrl_trans_affine_h_
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include "rgrl_transformation.h"
00012 #include <vcl_iosfwd.h>
00013
00014 class rgrl_trans_affine
00015 : public rgrl_transformation
00016 {
00017 public:
00018
00019
00020 rgrl_trans_affine( unsigned int dimension = 0);
00021
00022
00023
00024
00025
00026
00027 rgrl_trans_affine( vnl_matrix<double> const& A,
00028 vnl_vector<double> const& trans,
00029 vnl_matrix<double> const& covar );
00030
00031
00032
00033
00034
00035 rgrl_trans_affine( vnl_matrix<double> const& A,
00036 vnl_vector<double> const& trans,
00037 vnl_vector<double> const& from_centre );
00038
00039
00040
00041
00042
00043
00044 rgrl_trans_affine( vnl_matrix<double> const& A,
00045 vnl_vector<double> const& trans );
00046
00047
00048
00049
00050
00051
00052
00053
00054 rgrl_trans_affine( vnl_matrix<double> const& A,
00055 vnl_vector<double> const& trans,
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
00064
00065
00066
00067
00068
00069
00070
00071
00072 vnl_matrix<double> const& A() const;
00073
00074
00075 vnl_vector<double> t() const;
00076
00077
00078 void inv_map( const vnl_vector<double>& to,
00079 bool initialize_next,
00080 const vnl_vector<double>& to_delta,
00081 vnl_vector<double>& from,
00082 vnl_vector<double>& from_next_est) const;
00083
00084
00085
00086 void inv_map( const vnl_vector<double>& to,
00087 vnl_vector<double>& from ) const;
00088
00089
00090 virtual bool is_invertible() const { return true; }
00091
00092
00093
00094 virtual rgrl_transformation_sptr inverse_transform() const;
00095
00096
00097 virtual void jacobian_wrt_loc( vnl_matrix<double>& jac, vnl_vector<double> const& from_loc ) const;
00098
00099
00100 vnl_vector<double> const & from_centre() { return from_centre_; }
00101
00102
00103 rgrl_transformation_sptr scale_by( double scale ) const;
00104
00105
00106 rgrl_type_macro( rgrl_trans_affine, rgrl_transformation );
00107
00108
00109 void write(vcl_ostream& os ) const;
00110
00111
00112 bool read(vcl_istream& is );
00113
00114
00115 rgrl_transformation_sptr clone() const;
00116
00117 protected:
00118 void map_loc( vnl_vector<double> const& from,
00119 vnl_vector<double> & to ) const;
00120
00121 void map_dir( vnl_vector<double> const& from_loc,
00122 vnl_vector<double> const& from_dir,
00123 vnl_vector<double> & to_dir ) const;
00124
00125 vnl_matrix<double> A_;
00126 vnl_vector<double> trans_;
00127 vnl_vector<double> from_centre_;
00128 };
00129
00130 #endif