Public Member Functions | Protected Attributes | List of all members
vgl_h_matrix_1d< T > Class Template Reference

A class to hold a line-to-line projective transformation matrix and to perform common operations using it e.g. More...

#include <vgl_algo_fwd.h>

Public Member Functions

 vgl_h_matrix_1d ()=default
 
 ~vgl_h_matrix_1d ()=default
 
 vgl_h_matrix_1d (vgl_h_matrix_1d< T > const &M)
 Copy constructor. More...
 
 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>. More...
 
 vgl_h_matrix_1d (T const *M)
 Constructor from 2x2 C-array. More...
 
 vgl_h_matrix_1d (std::istream &s)
 Constructor from istream. More...
 
 vgl_h_matrix_1d (char const *filename)
 Constructor from file. More...
 
 vgl_h_matrix_1d (std::vector< vgl_homg_point_1d< T > > const &points1, std::vector< vgl_homg_point_1d< T > > const &points2)
 Constructor - calculate homography between two sets of 1D points (minimum 3). More...
 
vgl_homg_point_1d< T > operator() (vgl_homg_point_1d< T > const &p) const
 Return the transformed point given by $q = {\tt H} p$. More...
 
vgl_homg_point_1d< T > operator * (vgl_homg_point_1d< T > const &p) const
 Return the transformed point given by $q = {\tt H} p$. More...
 
vgl_homg_point_1d< T > correlation (vgl_homg_point_1d< T > const &p) const
 
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$. More...
 
bool operator== (vgl_h_matrix_1d< T > const &M) const
 
vgl_h_matrix_1d< T > operator * (vgl_h_matrix_1d< T > const &H) const
 product of two vgl_h_matrix_1ds. More...
 
vnl_matrix_fixed< T, 2, 2 > const & get_matrix () const
 Return the 2x2 homography matrix. More...
 
void get (vnl_matrix_fixed< T, 2, 2 > *M) const
 Fill M with contents of the 2x2 homography matrix. More...
 
void get (vnl_matrix< T > *M) const
 
void get (T *M) const
 Fill M with contents of the 2x2 homography matrix. More...
 
get (unsigned int row_index, unsigned int col_index) const
 Return an element from the 2x2 homography matrix. More...
 
vgl_h_matrix_1d get_inverse () const
 Return the inverse homography. More...
 
bool is_rotation () const
 
bool is_euclidean () const
 
bool is_identity () const
 
bool projective_basis (std::vector< vgl_homg_point_1d< T > > const &three_points)
 transformation to projective basis (canonical frame). More...
 
vgl_h_matrix_1dset_identity ()
 initialize the transformation to identity. More...
 
vgl_h_matrix_1dset (T const *M)
 Set to 2x2 row-stored matrix. More...
 
vgl_h_matrix_1dset (vnl_matrix_fixed< T, 2, 2 > const &M)
 Set to given 2x2 matrix. More...
 
vgl_h_matrix_1dset (unsigned int row_index, unsigned int col_index, T value)
 Set an element of the 2x2 homography matrix. More...
 
vgl_h_matrix_1dset_scale (T scale)
 compose the current transform with a uniform scaling transformation, S. More...
 
vgl_h_matrix_1dset_translation (T tx)
 set H[0][1] = tx, other elements unaltered. More...
 
vgl_h_matrix_1dset_affine (vnl_matrix_fixed< T, 1, 2 > const &M12)
 set the transform to a general affine transform matrix. More...
 
bool read (char const *filename)
 Read H from file. More...
 
bool read (std::istream &s)
 Read H from std::istream. More...
 

Protected Attributes

vnl_matrix_fixed< T, 2, 2 > t12_matrix_
 

Detailed Description

template<class T>
class vgl_h_matrix_1d< T >

A class to hold a line-to-line projective transformation matrix and to perform common operations using it e.g.

transfer point.

Definition at line 10 of file vgl_algo_fwd.h.

Constructor & Destructor Documentation

◆ vgl_h_matrix_1d() [1/7]

template<class T>
vgl_h_matrix_1d< T >::vgl_h_matrix_1d ( )
default

◆ ~vgl_h_matrix_1d()

template<class T>
vgl_h_matrix_1d< T >::~vgl_h_matrix_1d ( )
default

◆ vgl_h_matrix_1d() [2/7]

template<class T>
vgl_h_matrix_1d< T >::vgl_h_matrix_1d ( vgl_h_matrix_1d< T > const &  M)
inline

Copy constructor.

Definition at line 51 of file vgl_h_matrix_1d.h.

◆ vgl_h_matrix_1d() [3/7]

template<class T>
vgl_h_matrix_1d< T >::vgl_h_matrix_1d ( vnl_matrix_fixed< T, 2, 2 > const &  M)
inline

Constructor from a 2x2 matrix, and implicit cast from vnl_matrix_fixed<T,2,2>.

Definition at line 54 of file vgl_h_matrix_1d.h.

◆ vgl_h_matrix_1d() [4/7]

template<class T>
vgl_h_matrix_1d< T >::vgl_h_matrix_1d ( T const *  M)
inlineexplicit

Constructor from 2x2 C-array.

Definition at line 57 of file vgl_h_matrix_1d.h.

◆ vgl_h_matrix_1d() [5/7]

template<class T >
vgl_h_matrix_1d< T >::vgl_h_matrix_1d ( std::istream &  s)
explicit

Constructor from istream.

Definition at line 22 of file vgl_h_matrix_1d.hxx.

◆ vgl_h_matrix_1d() [6/7]

template<class T >
vgl_h_matrix_1d< T >::vgl_h_matrix_1d ( char const *  filename)
explicit

Constructor from file.

Definition at line 96 of file vgl_h_matrix_1d.hxx.

◆ vgl_h_matrix_1d() [7/7]

template<class T >
vgl_h_matrix_1d< T >::vgl_h_matrix_1d ( std::vector< vgl_homg_point_1d< T > > const &  points1,
std::vector< vgl_homg_point_1d< T > > const &  points2 
)

Constructor - calculate homography between two sets of 1D points (minimum 3).

Definition at line 28 of file vgl_h_matrix_1d.hxx.

Member Function Documentation

◆ correlation()

template<class T>
vgl_homg_point_1d<T> vgl_h_matrix_1d< T >::correlation ( vgl_homg_point_1d< T > const &  p) const
inline

Definition at line 72 of file vgl_h_matrix_1d.h.

◆ get() [1/4]

template<class T >
void vgl_h_matrix_1d< T >::get ( vnl_matrix_fixed< T, 2, 2 > *  M) const

Fill M with contents of the 2x2 homography matrix.

Definition at line 131 of file vgl_h_matrix_1d.hxx.

◆ get() [2/4]

template<class T >
void vgl_h_matrix_1d< T >::get ( vnl_matrix< T > *  M) const
Deprecated:
use the vnl_matrix_fixed variant instead

Definition at line 137 of file vgl_h_matrix_1d.hxx.

◆ get() [3/4]

template<class T >
void vgl_h_matrix_1d< T >::get ( T *  M) const

Fill M with contents of the 2x2 homography matrix.

Definition at line 124 of file vgl_h_matrix_1d.hxx.

◆ get() [4/4]

template<class T >
T vgl_h_matrix_1d< T >::get ( unsigned int  row_index,
unsigned int  col_index 
) const

Return an element from the 2x2 homography matrix.

Definition at line 118 of file vgl_h_matrix_1d.hxx.

◆ get_inverse()

template<class T >
vgl_h_matrix_1d< T > vgl_h_matrix_1d< T >::get_inverse ( ) const

Return the inverse homography.

Definition at line 75 of file vgl_h_matrix_1d.hxx.

◆ get_matrix()

template<class T>
vnl_matrix_fixed<T,2,2> const& vgl_h_matrix_1d< T >::get_matrix ( ) const
inline

Return the 2x2 homography matrix.

Definition at line 86 of file vgl_h_matrix_1d.h.

◆ is_euclidean()

template<class T >
bool vgl_h_matrix_1d< T >::is_euclidean ( ) const

Definition at line 261 of file vgl_h_matrix_1d.hxx.

◆ is_identity()

template<class T >
bool vgl_h_matrix_1d< T >::is_identity ( ) const

Definition at line 247 of file vgl_h_matrix_1d.hxx.

◆ is_rotation()

template<class T >
bool vgl_h_matrix_1d< T >::is_rotation ( ) const

Definition at line 253 of file vgl_h_matrix_1d.hxx.

◆ operator *() [1/2]

template<class T>
vgl_homg_point_1d<T> vgl_h_matrix_1d< T >::operator * ( vgl_homg_point_1d< T > const &  p) const
inline

Return the transformed point given by $q = {\tt H} p$.

Definition at line 71 of file vgl_h_matrix_1d.h.

◆ operator *() [2/2]

template<class T>
vgl_h_matrix_1d<T> vgl_h_matrix_1d< T >::operator * ( vgl_h_matrix_1d< T > const &  H) const
inline

product of two vgl_h_matrix_1ds.

Definition at line 80 of file vgl_h_matrix_1d.h.

◆ operator()()

template<class T >
vgl_homg_point_1d< T > vgl_h_matrix_1d< T >::operator() ( vgl_homg_point_1d< T > const &  p) const

Return the transformed point given by $q = {\tt H} p$.

Definition at line 59 of file vgl_h_matrix_1d.hxx.

◆ operator==()

template<class T>
bool vgl_h_matrix_1d< T >::operator== ( vgl_h_matrix_1d< T > const &  M) const
inline

Definition at line 77 of file vgl_h_matrix_1d.h.

◆ preimage()

template<class T >
vgl_homg_point_1d< T > vgl_h_matrix_1d< T >::preimage ( vgl_homg_point_1d< T > const &  q) const

Return the transformed point given by $p = {\tt H}^{-1} q$.

Definition at line 67 of file vgl_h_matrix_1d.hxx.

◆ projective_basis()

template<class T >
bool vgl_h_matrix_1d< T >::projective_basis ( std::vector< vgl_homg_point_1d< T > > const &  three_points)

transformation to projective basis (canonical frame).

Compute the homography that takes the input set of points to the canonical frame. The points act as the projective basis for the canonical coordinate system. In the canonical frame the points have coordinates:

   p[0]p[1]p[2]
     1   0   1
     0   1   1

Definition at line 198 of file vgl_h_matrix_1d.hxx.

◆ read() [1/2]

template<class T >
bool vgl_h_matrix_1d< T >::read ( char const *  filename)

Read H from file.

Definition at line 106 of file vgl_h_matrix_1d.hxx.

◆ read() [2/2]

template<class T >
bool vgl_h_matrix_1d< T >::read ( std::istream &  s)

Read H from std::istream.

Definition at line 88 of file vgl_h_matrix_1d.hxx.

◆ set() [1/3]

template<class T >
vgl_h_matrix_1d< T > & vgl_h_matrix_1d< T >::set ( T const *  M)

Set to 2x2 row-stored matrix.

Definition at line 145 of file vgl_h_matrix_1d.hxx.

◆ set() [2/3]

template<class T >
vgl_h_matrix_1d< T > & vgl_h_matrix_1d< T >::set ( vnl_matrix_fixed< T, 2, 2 > const &  M)

Set to given 2x2 matrix.

Definition at line 154 of file vgl_h_matrix_1d.hxx.

◆ set() [3/3]

template<class T>
vgl_h_matrix_1d& vgl_h_matrix_1d< T >::set ( unsigned int  row_index,
unsigned int  col_index,
value 
)
inline

Set an element of the 2x2 homography matrix.

Definition at line 123 of file vgl_h_matrix_1d.h.

◆ set_affine()

template<class T >
vgl_h_matrix_1d< T > & vgl_h_matrix_1d< T >::set_affine ( vnl_matrix_fixed< T, 1, 2 > const &  M12)

set the transform to a general affine transform matrix.

$A = \left[ \begin{array}{ccc} a00 & a01 \% 0 & 1 \end{array}\right]$

Definition at line 187 of file vgl_h_matrix_1d.hxx.

◆ set_identity()

template<class T >
vgl_h_matrix_1d< T > & vgl_h_matrix_1d< T >::set_identity ( )

initialize the transformation to identity.

Definition at line 162 of file vgl_h_matrix_1d.hxx.

◆ set_scale()

template<class T >
vgl_h_matrix_1d< T > & vgl_h_matrix_1d< T >::set_scale ( scale)

compose the current transform with a uniform scaling transformation, S.

$S = \left[ \begin{array}{cc} s & 0 \% 0 & 1 \end{array}\right]$ , Ts = S*T.

Definition at line 170 of file vgl_h_matrix_1d.hxx.

◆ set_translation()

template<class T >
vgl_h_matrix_1d< T > & vgl_h_matrix_1d< T >::set_translation ( tx)

set H[0][1] = tx, other elements unaltered.

Definition at line 179 of file vgl_h_matrix_1d.hxx.

Member Data Documentation

◆ t12_matrix_

template<class T>
vnl_matrix_fixed<T,2,2> vgl_h_matrix_1d< T >::t12_matrix_
protected

Definition at line 41 of file vgl_h_matrix_1d.h.


The documentation for this class was generated from the following files: