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