Go to the documentation of this file.00001
00002 #ifndef vgl_h_matrix_1d_h_
00003 #define vgl_h_matrix_1d_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include <vnl/vnl_matrix_fixed.h>
00023 #include <vgl/vgl_homg_point_1d.h>
00024 #include <vcl_iosfwd.h>
00025
00026 template <class T>
00027 class vgl_h_matrix_1d
00028 {
00029
00030 protected:
00031 vnl_matrix_fixed<T,2,2> t12_matrix_;
00032
00033 public:
00034
00035
00036
00037 vgl_h_matrix_1d();
00038 vgl_h_matrix_1d(const vgl_h_matrix_1d<T>& M);
00039
00040 vgl_h_matrix_1d(const vgl_h_matrix_1d<T>&,const vgl_h_matrix_1d<T>&);
00041 vgl_h_matrix_1d(vnl_matrix_fixed<T,2,2> const& M);
00042 vgl_h_matrix_1d(const T* t_matrix);
00043 vgl_h_matrix_1d(vcl_istream& s);
00044 ~vgl_h_matrix_1d();
00045
00046
00047
00048 vgl_homg_point_1d<T> operator()(const vgl_homg_point_1d<T>& x1) const;
00049 vgl_homg_point_1d<T> preimage(const vgl_homg_point_1d<T>& x2) const;
00050 vgl_homg_point_1d<T> operator* (const vgl_homg_point_1d<T>& x1) const;
00051 bool operator==(vgl_h_matrix_1d<T> const& M) { return t12_matrix_ == M.get_matrix(); }
00052
00053
00054
00055 T get (unsigned int row_index, unsigned int col_index) const;
00056 void get (T *t_matrix) const;
00057 void get (vnl_matrix<T>* t_matrix) const;
00058 const vnl_matrix_fixed<T,2,2>& get_matrix () const { return t12_matrix_; }
00059 const vgl_h_matrix_1d get_inverse () const;
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071 bool projective_basis(vcl_vector<vgl_homg_point_1d<T> > const& three_points);
00072
00073 void set_identity() { t12_matrix_.set_identity(); }
00074 void set(const T *t_matrix);
00075 void set(vnl_matrix_fixed<T,2,2> const& t_matrix);
00076
00077 static vgl_h_matrix_1d<T> read(char const* filename);
00078 static vgl_h_matrix_1d<T> read(vcl_istream&);
00079 };
00080
00081 template <class T> vcl_ostream& operator<<(vcl_ostream& s, const vgl_h_matrix_1d<T>& h);
00082 template <class T> vcl_istream& operator>>(vcl_istream& s, vgl_h_matrix_1d<T>& h);
00083
00084
00085 #define VGL_H_MATRIX_1D_INSTANTIATE(T) extern "please include vgl/algo/vgl_h_matrix_1d.txx first"
00086
00087 #endif // vgl_h_matrix_1d_h_