2 #ifndef vgl_h_matrix_1d_h_ 3 #define vgl_h_matrix_1d_h_ 27 #include <vnl/vnl_matrix_fixed.h> 30 # include <vcl_msvc_warnings.h> 88 void get (vnl_matrix_fixed<T,2,2>* M)
const;
91 void get (vnl_matrix<T>* M)
const;
93 void get (T* M)
const;
95 T
get (
unsigned int row_index,
unsigned int col_index)
const;
124 {
t12_matrix_[row_index][col_index]=value;
return *
this; }
144 bool read(
char const* filename);
146 bool read(std::istream& s);
153 { H.
read(s);
return s; }
156 #define VGL_H_MATRIX_1D_INSTANTIATE(T) extern "please include vgl/algo/vgl_h_matrix_1d.hxx first" 158 #endif // vgl_h_matrix_1d_h_ vgl_h_matrix_1d & set(unsigned int row_index, unsigned int col_index, T value)
Set an element of the 2x2 homography matrix.
A class to hold a line-to-line projective transformation matrix and to perform common operations usin...
a point in homogeneous 1-D space, i.e., a homogeneous pair (x,w)
bool operator==(vgl_h_matrix_1d< T > const &M) const
vgl_h_matrix_1d & set_translation(T tx)
set H[0][1] = tx, other elements unaltered.
vgl_homg_point_1d< T > correlation(vgl_homg_point_1d< T > const &p) const
vgl_h_matrix_1d & set_scale(T scale)
compose the current transform with a uniform scaling transformation, S.
bool is_euclidean() const
std::ostream & operator<<(std::ostream &s, vgl_orient_box_3d< Type > const &p)
Write box to stream.
void get(vnl_matrix_fixed< T, 2, 2 > *M) const
Fill M with contents of the 2x2 homography matrix.
bool projective_basis(std::vector< vgl_homg_point_1d< T > > const &three_points)
transformation to projective basis (canonical frame).
vgl_h_matrix_1d & set_affine(vnl_matrix_fixed< T, 1, 2 > const &M12)
set the transform to a general affine transform matrix.
vgl_h_matrix_1d(vgl_h_matrix_1d< T > const &M)
Copy constructor.
vgl_homg_point_1d< T > operator()(vgl_homg_point_1d< T > const &p) const
Return the transformed point given by $q = {\tt H} p$.
vgl_h_matrix_1d & set(T const *M)
Set to 2x2 row-stored matrix.
vnl_matrix_fixed< T, 2, 2 > const & get_matrix() const
Return the 2x2 homography matrix.
bool read(char const *filename)
Read H from file.
vgl_h_matrix_1d(vnl_matrix_fixed< T, 2, 2 > const &M)
Constructor from a 2x2 matrix, and implicit cast from vnl_matrix_fixed<T,2,2>.
vgl_h_matrix_1d(T const *M)
Constructor from 2x2 C-array.
vgl_h_matrix_1d & set_identity()
initialize the transformation to identity.
std::istream & operator>>(std::istream &is, vgl_orient_box_3d< Type > &p)
Read box from stream.
vnl_matrix_fixed< T, 2, 2 > t12_matrix_
vgl_h_matrix_1d get_inverse() const
Return the inverse homography.
vgl_homg_point_1d< T > preimage(vgl_homg_point_1d< T > const &q) const
Return the transformed point given by $p = {\tt H}^{-1} q$.
Represents a homogeneous 1-D point, i.e., a homogeneous pair (x,w).
vgl_homg_point_1d< T > operator *(vgl_homg_point_1d< T > const &p) const
Return the transformed point given by $q = {\tt H} p$.
~vgl_h_matrix_1d()=default
vgl_h_matrix_1d()=default