Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

vgl_h_matrix_2d< T > Class Template Reference

#include <vgl_h_matrix_2d.h>

Inheritance diagram for vgl_h_matrix_2d< T >:

Inheritance graph
[legend]
List of all members.

Detailed Description

template<class T>
class vgl_h_matrix_2d< T >

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

transfer point.

Definition at line 30 of file vgl_h_matrix_2d.h.

Public Member Functions

 vgl_h_matrix_2d ()
 Default constructor.
 vgl_h_matrix_2d (const vgl_h_matrix_2d< T > &M)
 Copy constructor.
 vgl_h_matrix_2d (vnl_matrix_fixed< T, 3, 3 > const &M)
 Constructor.
 vgl_h_matrix_2d (const T *t_matrix)
 Constructor.
 vgl_h_matrix_2d (vcl_istream &s)
 Constructor from vcl_istream.
 vgl_h_matrix_2d (char const *filename)
 Constructor from file.
 ~vgl_h_matrix_2d ()
 Destructor.
vgl_homg_point_2d< T > operator() (vgl_homg_point_2d< T > const &p) const
vgl_homg_point_2d< T > operator * (vgl_homg_point_2d< T > const &p) const
vgl_homg_line_2d< T > preimage (vgl_homg_line_2d< T > const &l) const
vgl_homg_line_2d< T > correlation (vgl_homg_point_2d< T > const &p) const
vgl_homg_point_2d< T > correlation (vgl_homg_line_2d< T > const &l) const
vgl_conic< T > operator() (vgl_conic< T > const &C) const
 assumed to be a point conic.
vgl_homg_point_2d< T > preimage (vgl_homg_point_2d< T > const &p) const
vgl_conic< T > preimage (vgl_conic< T > const &C) const
vgl_homg_line_2d< T > operator() (vgl_homg_line_2d< T > const &l) const
vgl_homg_line_2d< T > operator * (vgl_homg_line_2d< T > const &l) const
vgl_h_matrix_2d operator * (const vgl_h_matrix_2d &h2) const
 Composition.
get (unsigned int row_index, unsigned int col_index) const
 Get matrix element at (row_index, col_index).
void get (T *t_matrix) const
 Fill H with contents of this.
void get (vnl_matrix< T > *t_matrix) const
 Fill H with contents of this.
const vnl_matrix_fixed< T, 3, 3 > & get_matrix () const
const vgl_h_matrix_2d get_inverse () const
 Return the inverse.
void set (const T *t_matrix)
 Set to 3x3 row-stored matrix.
void set (vnl_matrix_fixed< T, 3, 3 > const &t_matrix)
 Set to given vnl_matrix.
void set_identity ()
 initialize the transformation to identity.
void set_translation (const T tx, const T ty)
 set T[0][2] = tx and T[1][2] = ty, other elements unaltered.
void set_rotation (const T theta)
 the upper 2x2 part of the matrix is replaced by a rotation matrix.
void set_scale (const T scale)
 initialize the transform to a scaling transform.
void set_aspect_ratio (const T aspect_ratio)
 initialize the transform to a diagonal aspect transform.
bool projective_basis (vcl_vector< vgl_homg_point_2d< T > > const &four_points)
 transformation to projective basis (canonical frame).
bool projective_basis (vcl_vector< vgl_homg_line_2d< T > > const &four_lines)
 transformation to projective basis (canonical frame).
bool read (vcl_istream &s)
 Read H from vcl_istream.
bool read (char const *filename)
 Read H from file.

Protected Attributes

vnl_matrix_fixed< T, 3, 3 > t12_matrix_


Constructor & Destructor Documentation

template<class T>
vgl_h_matrix_2d< T >::vgl_h_matrix_2d  ) 
 

Default constructor.

Definition at line 18 of file vgl_h_matrix_2d.txx.

template<class T>
vgl_h_matrix_2d< T >::vgl_h_matrix_2d const vgl_h_matrix_2d< T > &  M  ) 
 

Copy constructor.

Definition at line 24 of file vgl_h_matrix_2d.txx.

template<class T>
vgl_h_matrix_2d< T >::vgl_h_matrix_2d vnl_matrix_fixed< T, 3, 3 > const &  M  ) 
 

Constructor.

Definition at line 51 of file vgl_h_matrix_2d.txx.

template<class T>
vgl_h_matrix_2d< T >::vgl_h_matrix_2d const T *  t_matrix  ) 
 

Constructor.

Definition at line 59 of file vgl_h_matrix_2d.txx.

template<class T>
vgl_h_matrix_2d< T >::vgl_h_matrix_2d vcl_istream &  s  ) 
 

Constructor from vcl_istream.

Definition at line 32 of file vgl_h_matrix_2d.txx.

template<class T>
vgl_h_matrix_2d< T >::vgl_h_matrix_2d char const *  filename  ) 
 

Constructor from file.

Definition at line 39 of file vgl_h_matrix_2d.txx.

template<class T>
vgl_h_matrix_2d< T >::~vgl_h_matrix_2d  ) 
 

Destructor.

Definition at line 67 of file vgl_h_matrix_2d.txx.


Member Function Documentation

template<class T>
vgl_homg_point_2d< T > vgl_h_matrix_2d< T >::correlation vgl_homg_line_2d< T > const &  l  )  const
 

Definition at line 102 of file vgl_h_matrix_2d.txx.

template<class T>
vgl_homg_line_2d< T > vgl_h_matrix_2d< T >::correlation vgl_homg_point_2d< T > const &  p  )  const
 

Definition at line 93 of file vgl_h_matrix_2d.txx.

template<class T>
void vgl_h_matrix_2d< T >::get vnl_matrix< T > *  t_matrix  )  const
 

Fill H with contents of this.

Definition at line 208 of file vgl_h_matrix_2d.txx.

template<class T>
void vgl_h_matrix_2d< T >::get T *  t_matrix  )  const
 

Fill H with contents of this.

Definition at line 199 of file vgl_h_matrix_2d.txx.

template<class T>
T vgl_h_matrix_2d< T >::get unsigned int  row_index,
unsigned int  col_index
const
 

Get matrix element at (row_index, col_index).

Definition at line 192 of file vgl_h_matrix_2d.txx.

template<class T>
const vgl_h_matrix_2d< T > vgl_h_matrix_2d< T >::get_inverse  )  const
 

Return the inverse.

Definition at line 354 of file vgl_h_matrix_2d.txx.

template<class T>
const vnl_matrix_fixed<T,3,3>& vgl_h_matrix_2d< T >::get_matrix  )  const [inline]
 

Definition at line 75 of file vgl_h_matrix_2d.h.

template<class T>
vgl_h_matrix_2d vgl_h_matrix_2d< T >::operator * const vgl_h_matrix_2d< T > &  h2  )  const [inline]
 

Composition.

Definition at line 68 of file vgl_h_matrix_2d.h.

template<class T>
vgl_homg_line_2d<T> vgl_h_matrix_2d< T >::operator * vgl_homg_line_2d< T > const &  l  )  const [inline]
 

Definition at line 65 of file vgl_h_matrix_2d.h.

template<class T>
vgl_homg_point_2d<T> vgl_h_matrix_2d< T >::operator * vgl_homg_point_2d< T > const &  p  )  const [inline]
 

Definition at line 52 of file vgl_h_matrix_2d.h.

template<class T>
vgl_homg_line_2d< T > vgl_h_matrix_2d< T >::operator() vgl_homg_line_2d< T > const &  l  )  const
 

Definition at line 147 of file vgl_h_matrix_2d.txx.

template<class T>
vgl_conic< T > vgl_h_matrix_2d< T >::operator() vgl_conic< T > const &  C  )  const
 

assumed to be a point conic.

Definition at line 110 of file vgl_h_matrix_2d.txx.

template<class T>
vgl_homg_point_2d< T > vgl_h_matrix_2d< T >::operator() vgl_homg_point_2d< T > const &  p  )  const
 

Definition at line 75 of file vgl_h_matrix_2d.txx.

template<class T>
vgl_conic< T > vgl_h_matrix_2d< T >::preimage vgl_conic< T > const &  C  )  const
 

Definition at line 123 of file vgl_h_matrix_2d.txx.

template<class T>
vgl_homg_point_2d< T > vgl_h_matrix_2d< T >::preimage vgl_homg_point_2d< T > const &  p  )  const
 

Definition at line 138 of file vgl_h_matrix_2d.txx.

template<class T>
vgl_homg_line_2d< T > vgl_h_matrix_2d< T >::preimage vgl_homg_line_2d< T > const &  l  )  const
 

Definition at line 84 of file vgl_h_matrix_2d.txx.

template<class T>
bool vgl_h_matrix_2d< T >::projective_basis vcl_vector< vgl_homg_line_2d< T > > const &  four_lines  ) 
 

transformation to projective basis (canonical frame).

Compute the homography that takes the input set of lines to the canonical frame. The lines act as the dual projective basis for the canonical coordinate system. In the canonical frame the lines have equations: x=0; y=0; w=0; x+y+w=0. (The third line is the line at infinity.)

Definition at line 294 of file vgl_h_matrix_2d.txx.

template<class T>
bool vgl_h_matrix_2d< T >::projective_basis vcl_vector< vgl_homg_point_2d< T > > const &  four_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: ${array}{cccc} p[0] & p[1] & p[2] & p[3] \% 1 & 0 & 0 & 1 \% 0 & 1 & 0 & 1 \% 0 & 0 & 1 & 1 {array}$

Definition at line 239 of file vgl_h_matrix_2d.txx.

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

Read H from file.

Definition at line 179 of file vgl_h_matrix_2d.txx.

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

Read H from vcl_istream.

Definition at line 172 of file vgl_h_matrix_2d.txx.

template<class T>
void vgl_h_matrix_2d< T >::set vnl_matrix_fixed< T, 3, 3 > const &  t_matrix  ) 
 

Set to given vnl_matrix.

Definition at line 231 of file vgl_h_matrix_2d.txx.

template<class T>
void vgl_h_matrix_2d< T >::set const T *  t_matrix  ) 
 

Set to 3x3 row-stored matrix.

Definition at line 222 of file vgl_h_matrix_2d.txx.

template<class T>
void vgl_h_matrix_2d< T >::set_aspect_ratio const T  aspect_ratio  ) 
 

initialize the transform to a diagonal aspect transform.

$A = [ {array}{ccc} 1 & 0 & 0 \% 0 & a & 0 \% 0 & 0 & 1 {array}]$ , Ta = A*T.

Definition at line 401 of file vgl_h_matrix_2d.txx.

template<class T>
void vgl_h_matrix_2d< T >::set_identity  ) 
 

initialize the transformation to identity.

Definition at line 215 of file vgl_h_matrix_2d.txx.

template<class T>
void vgl_h_matrix_2d< T >::set_rotation const T  theta  ) 
 

the upper 2x2 part of the matrix is replaced by a rotation matrix.

theta is in radians

Definition at line 370 of file vgl_h_matrix_2d.txx.

template<class T>
void vgl_h_matrix_2d< T >::set_scale const T  scale  ) 
 

initialize the transform to a scaling transform.

$S = [ {array}{ccc} s & 0 & 0 \% 0 & s & 0 \% 0 & 0 & 1 {array}]$ , Ts = S*T.

Definition at line 386 of file vgl_h_matrix_2d.txx.

template<class T>
void vgl_h_matrix_2d< T >::set_translation const T  tx,
const T  ty
 

set T[0][2] = tx and T[1][2] = ty, other elements unaltered.

Definition at line 363 of file vgl_h_matrix_2d.txx.


Member Data Documentation

template<class T>
vnl_matrix_fixed<T,3,3> vgl_h_matrix_2d< T >::t12_matrix_ [protected]
 

Definition at line 34 of file vgl_h_matrix_2d.h.


The documentation for this class was generated from the following files:
Generated on Thu Jan 10 14:39:26 2008 for core/vgl by  doxygen 1.4.4