Go to the documentation of this file.00001 #ifndef rgrl_trans_rigid_h_
00002 #define rgrl_trans_rigid_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
00020
00021 class rgrl_trans_rigid
00022 : public rgrl_transformation
00023 {
00024 public:
00025
00026
00027 rgrl_trans_rigid( unsigned int dimension = 0);
00028
00029
00030
00031 rgrl_trans_rigid( vnl_matrix<double> const& rot,
00032 vnl_vector<double> const& trans,
00033 vnl_matrix<double> const& covar );
00034
00035
00036
00037
00038 rgrl_trans_rigid( vnl_matrix<double> const& rot,
00039 vnl_vector<double> const& trans );
00040
00041
00042
00043 void set_translation(double tx, double ty, double tz);
00044
00045
00046
00047 void set_translation(double tx, double ty);
00048
00049
00050
00051 void set_rotation(double theta, double alpha, double phi);
00052
00053
00054
00055 void set_rotation(double theta);
00056
00057
00058
00059 void determine_angles( double& phi, double& alpha, double& theta) const;
00060
00061
00062
00063 void determine_angles( double& theta ) const;
00064
00065
00066 vnl_matrix<double> transfer_error_covar( vnl_vector<double> const& p ) const;
00067
00068
00069 vnl_matrix<double> const& R() const;
00070
00071
00072 vnl_vector<double> t() const;
00073
00074
00075 void inv_map( const vnl_vector<double>& to,
00076 bool initialize_next,
00077 const vnl_vector<double>& to_delta,
00078 vnl_vector<double>& from,
00079 vnl_vector<double>& from_next_est) const;
00080
00081
00082
00083 void inv_map( const vnl_vector<double>& to,
00084 vnl_vector<double>& from ) const;
00085
00086
00087 virtual bool is_invertible() const { return true; }
00088
00089
00090
00091 virtual rgrl_transformation_sptr inverse_transform() const;
00092
00093
00094 virtual void jacobian_wrt_loc( vnl_matrix<double>& jac, vnl_vector<double> const& from_loc ) const;
00095
00096
00097 rgrl_transformation_sptr scale_by( double scale ) const;
00098
00099
00100 rgrl_type_macro( rgrl_trans_rigid, 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<double> R_;
00121 vnl_vector<double> trans_;
00122 };
00123
00124
00125 #endif