Public Member Functions | Protected Attributes
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_h_matrix_1d.h>

List of all members.

Public Member Functions

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

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 37 of file vgl_h_matrix_1d.h.


Constructor & Destructor Documentation

template<class T>
vgl_h_matrix_1d< T >::vgl_h_matrix_1d ( ) [inline]

Definition at line 47 of file vgl_h_matrix_1d.h.

template<class T>
vgl_h_matrix_1d< T >::~vgl_h_matrix_1d ( ) [inline]

Definition at line 48 of file vgl_h_matrix_1d.h.

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.

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.

template<class T>
vgl_h_matrix_1d< T >::vgl_h_matrix_1d ( T const *  M) [inline, explicit]

Constructor from 2x2 C-array.

Definition at line 57 of file vgl_h_matrix_1d.h.

template<class T >
vgl_h_matrix_1d< T >::vgl_h_matrix_1d ( vcl_istream &  s) [explicit]

Constructor from istream.

Definition at line 17 of file vgl_h_matrix_1d.txx.

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

Constructor from file.

Definition at line 91 of file vgl_h_matrix_1d.txx.

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

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

Definition at line 23 of file vgl_h_matrix_1d.txx.


Member Function Documentation

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.

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 126 of file vgl_h_matrix_1d.txx.

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 132 of file vgl_h_matrix_1d.txx.

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 119 of file vgl_h_matrix_1d.txx.

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 113 of file vgl_h_matrix_1d.txx.

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

Return the inverse homography.

Definition at line 70 of file vgl_h_matrix_1d.txx.

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.

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

Definition at line 256 of file vgl_h_matrix_1d.txx.

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

Definition at line 242 of file vgl_h_matrix_1d.txx.

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

Definition at line 248 of file vgl_h_matrix_1d.txx.

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 = { H} p$.

Definition at line 54 of file vgl_h_matrix_1d.txx.

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 = { H} p$.

Definition at line 71 of file vgl_h_matrix_1d.h.

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.

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.

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 = { H}^{-1} q$.

Definition at line 62 of file vgl_h_matrix_1d.txx.

template<class T >
bool vgl_h_matrix_1d< T >::projective_basis ( vcl_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 193 of file vgl_h_matrix_1d.txx.

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

Read H from file.

Definition at line 101 of file vgl_h_matrix_1d.txx.

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

Read H from vcl_istream.

Definition at line 83 of file vgl_h_matrix_1d.txx.

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 140 of file vgl_h_matrix_1d.txx.

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 149 of file vgl_h_matrix_1d.txx.

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.

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 = [ {array}{ccc} a00 & a01 \% 0 & 1 {array}]$

Definition at line 182 of file vgl_h_matrix_1d.txx.

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

initialize the transformation to identity.

Definition at line 157 of file vgl_h_matrix_1d.txx.

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 = [ {array}{cc} s & 0 \% 0 & 1 {array}]$ , Ts = S*T.

Definition at line 165 of file vgl_h_matrix_1d.txx.

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 174 of file vgl_h_matrix_1d.txx.


Member Data Documentation

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: