Public Member Functions | Static Protected Member Functions | Protected Attributes
vgl_norm_trans_2d< T > Class Template Reference

#include <vgl_norm_trans_2d.h>

Inheritance diagram for vgl_norm_trans_2d< T >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 vgl_norm_trans_2d ()
 vgl_norm_trans_2d (const vgl_norm_trans_2d< T > &M)
 vgl_norm_trans_2d (vnl_matrix_fixed< T, 3, 3 > const &M)
 vgl_norm_trans_2d (const T *t_matrix)
 vgl_norm_trans_2d (vcl_istream &s)
 vgl_norm_trans_2d (char const *filename)
 ~vgl_norm_trans_2d ()
bool compute_from_points (vcl_vector< vgl_homg_point_2d< T > > const &points, bool isotropic=true)
 compute the normalizing transform.
bool compute_from_lines (vcl_vector< vgl_homg_line_2d< T > > const &lines, bool isotropic=true)
 The normalizing transform for lines is computed from the set of points defined by the intersection of the perpendicular from the origin with the line.
bool compute_from_points_and_lines (vcl_vector< vgl_homg_point_2d< T > > const &pts, vcl_vector< vgl_homg_line_2d< T > > const &lines, bool isotropic=true)
 The normalizing transform for points and lines is computed from the set of points used by compute_from_points() & the one used by compute_from_lines().
vgl_homg_point_2d< T > operator() (vgl_homg_point_2d< T > const &p) const
 Return the transformed point given by $q = { H} p$.
vgl_conic< T > operator() (vgl_conic< T > const &C) const
 assumed to be a point conic.
vgl_homg_line_2d< T > operator() (vgl_homg_line_2d< T > const &l) const
 Return the transformed line given by $m = { H}^{-1} l$.
vgl_homg_point_2d< T > operator* (vgl_homg_point_2d< T > const &p) const
 Return the transformed point given by $q = { H} p$.
vgl_homg_line_2d< T > operator* (vgl_homg_line_2d< T > const &l) const
 Return the transformed line given by $m = { H}^{-1} l$.
vgl_h_matrix_2d< T > operator* (vgl_h_matrix_2d< T > const &H) const
 composition (*this) * H.
bool operator== (vgl_h_matrix_2d< T > const &M) const
vgl_homg_line_2d< T > preimage (vgl_homg_line_2d< T > const &l) const
 Return the transformed line given by $m = { H} l$.
vgl_homg_point_2d< T > preimage (vgl_homg_point_2d< T > const &q) const
 Return the transformed point given by $p = { H}^{-1} q$.
vgl_conic< T > preimage (vgl_conic< T > const &C) const
 assumed to be a point conic.
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
vnl_matrix_fixed< T, 3, 3 > const & get_matrix () const
 Return the 3x3 homography matrix.
void get (vnl_matrix_fixed< T, 3, 3 > *M) const
 Fill M with contents of the 3x3 homography matrix.
void get (vnl_matrix< T > *M) const
void get (T *M) const
 Fill M with contents of the 3x3 homography matrix.
get (unsigned int row_index, unsigned int col_index) const
 Return an element from the 3x3 homography matrix.
vgl_h_matrix_2d get_inverse () const
 Return the inverse homography.
vgl_h_matrix_2dset (unsigned int row_index, unsigned int col_index, T value)
 Set an element of the 3x3 homography matrix.
vgl_h_matrix_2dset (T const *M)
 Set to 3x3 row-stored matrix.
vgl_h_matrix_2dset (vnl_matrix_fixed< T, 3, 3 > const &M)
 Set to given 3x3 matrix.
vgl_h_matrix_2dset_identity ()
 initialize the transformation to identity.
vgl_h_matrix_2dset_translation (T tx, T ty)
 set H[0][2] = tx and H[1][2] = ty, other elements unaltered.
vgl_h_matrix_2dset_rotation (T theta)
 the upper 2x2 part of the matrix is replaced by a rotation matrix.
vgl_h_matrix_2dset_scale (T scale)
 compose the current transform with a uniform scaling transformation, S.
vgl_h_matrix_2dset_similarity (T s, T theta, T tx, T ty)
 set the transform to a similarity mapping.
vgl_h_matrix_2dset_aspect_ratio (T aspect_ratio)
 compose the transform with diagonal aspect ratio transform.
vgl_h_matrix_2dset_affine (vnl_matrix_fixed< T, 2, 3 > const &M23)
 set the transform to a general affine transform matrix.
vgl_h_matrix_2dset_affine (vnl_matrix< T > const &M23)
bool is_rotation () const
bool is_euclidean () const
bool is_identity () const
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).
vgl_h_matrix_2d< T > get_upper_2x2 () const
 corresponds to rotation for Euclidean transformations.
vnl_matrix_fixed< T, 2, 2 > get_upper_2x2_matrix () const
 corresponds to rotation for Euclidean transformations.
vgl_homg_point_2d< T > get_translation () const
 corresponds to translation for affine transformations.
vnl_vector_fixed< T, 2 > get_translation_vector () const
 corresponds to translation for affine transformations.
bool read (vcl_istream &s)
 Read H from vcl_istream.
bool read (char const *filename)
 Read H from file.

Static Protected Member Functions

static bool scale_xyroot2 (vcl_vector< vgl_homg_point_2d< T > > const &in, T &radius)
static void center_of_mass (vcl_vector< vgl_homg_point_2d< T > > const &points, T &cx, T &cy)
static bool scale_aniostropic (vcl_vector< vgl_homg_point_2d< T > > const &in, T &sdx, T &sdy, T &c, T &s)

Protected Attributes

vnl_matrix_fixed< T, 3, 3 > t12_matrix_

Detailed Description

template<class T>
class vgl_norm_trans_2d< T >

Definition at line 38 of file vgl_norm_trans_2d.h.


Constructor & Destructor Documentation

template<class T >
vgl_norm_trans_2d< T >::vgl_norm_trans_2d ( )

Definition at line 17 of file vgl_norm_trans_2d.txx.

template<class T >
vgl_norm_trans_2d< T >::vgl_norm_trans_2d ( const vgl_norm_trans_2d< T > &  M)

Definition at line 23 of file vgl_norm_trans_2d.txx.

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

Definition at line 46 of file vgl_norm_trans_2d.txx.

template<class T >
vgl_norm_trans_2d< T >::vgl_norm_trans_2d ( const T *  t_matrix)

Definition at line 54 of file vgl_norm_trans_2d.txx.

template<class T >
vgl_norm_trans_2d< T >::vgl_norm_trans_2d ( vcl_istream &  s)

Definition at line 31 of file vgl_norm_trans_2d.txx.

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

Definition at line 38 of file vgl_norm_trans_2d.txx.

template<class T >
vgl_norm_trans_2d< T >::~vgl_norm_trans_2d ( )

Definition at line 61 of file vgl_norm_trans_2d.txx.


Member Function Documentation

template<class T >
void vgl_norm_trans_2d< T >::center_of_mass ( vcl_vector< vgl_homg_point_2d< T > > const &  points,
T &  cx,
T &  cy 
) [static, protected]

Definition at line 158 of file vgl_norm_trans_2d.txx.

template<class T >
bool vgl_norm_trans_2d< T >::compute_from_lines ( vcl_vector< vgl_homg_line_2d< T > > const &  lines,
bool  isotropic = true 
)

The normalizing transform for lines is computed from the set of points defined by the intersection of the perpendicular from the origin with the line.

Each such point is given by: $p = [-a*c, -b*c, \sqrt(a^2+b^2)]^T$ If we assume the line is normalized then: $p = [-a*c, -b*c, 1]^T$

Definition at line 117 of file vgl_norm_trans_2d.txx.

template<class T >
bool vgl_norm_trans_2d< T >::compute_from_points ( vcl_vector< vgl_homg_point_2d< T > > const &  points,
bool  isotropic = true 
)

compute the normalizing transform.

Get the normalizing transform for a set of points.

  • Compute the center of gravity & form the normalizing transformation matrix
  • Transform the point set to a temporary collection
  • Compute the average point radius
  • Complete the normalizing transform

Definition at line 74 of file vgl_norm_trans_2d.txx.

template<class T >
bool vgl_norm_trans_2d< T >::compute_from_points_and_lines ( vcl_vector< vgl_homg_point_2d< T > > const &  pts,
vcl_vector< vgl_homg_line_2d< T > > const &  lines,
bool  isotropic = true 
)

The normalizing transform for points and lines is computed from the set of points used by compute_from_points() & the one used by compute_from_lines().

Definition at line 138 of file vgl_norm_trans_2d.txx.

template<class T>
vgl_homg_line_2d< T > vgl_h_matrix_2d< T >::correlation ( vgl_homg_point_2d< T > const &  p) const [inherited]

Definition at line 91 of file vgl_h_matrix_2d.txx.

template<class T>
vgl_homg_point_2d< T > vgl_h_matrix_2d< T >::correlation ( vgl_homg_line_2d< T > const &  l) const [inherited]

Definition at line 107 of file vgl_h_matrix_2d.txx.

template<class T>
void vgl_h_matrix_2d< T >::get ( vnl_matrix_fixed< T, 3, 3 > *  M) const [inherited]

Fill M with contents of the 3x3 homography matrix.

Definition at line 196 of file vgl_h_matrix_2d.txx.

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

Definition at line 202 of file vgl_h_matrix_2d.txx.

template<class T>
void vgl_h_matrix_2d< T >::get ( T *  M) const [inherited]

Fill M with contents of the 3x3 homography matrix.

Definition at line 189 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 [inherited]

Return an element from the 3x3 homography matrix.

Definition at line 183 of file vgl_h_matrix_2d.txx.

template<class T >
vgl_h_matrix_2d< T > vgl_h_matrix_2d< T >::get_inverse ( ) const [inherited]

Return the inverse homography.

Definition at line 376 of file vgl_h_matrix_2d.txx.

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

Return the 3x3 homography matrix.

Definition at line 99 of file vgl_h_matrix_2d.h.

template<class T >
vgl_homg_point_2d< T > vgl_h_matrix_2d< T >::get_translation ( ) const [inherited]

corresponds to translation for affine transformations.

Definition at line 487 of file vgl_h_matrix_2d.txx.

template<class T >
vnl_vector_fixed< T, 2 > vgl_h_matrix_2d< T >::get_translation_vector ( ) const [inherited]

corresponds to translation for affine transformations.

Definition at line 499 of file vgl_h_matrix_2d.txx.

template<class T >
vgl_h_matrix_2d< T > vgl_h_matrix_2d< T >::get_upper_2x2 ( ) const [inherited]

corresponds to rotation for Euclidean transformations.

Definition at line 460 of file vgl_h_matrix_2d.txx.

template<class T >
vnl_matrix_fixed< T, 2, 2 > vgl_h_matrix_2d< T >::get_upper_2x2_matrix ( ) const [inherited]

corresponds to rotation for Euclidean transformations.

Definition at line 475 of file vgl_h_matrix_2d.txx.

template<class T >
bool vgl_h_matrix_2d< T >::is_euclidean ( ) const [inherited]

Definition at line 297 of file vgl_h_matrix_2d.txx.

template<class T >
bool vgl_h_matrix_2d< T >::is_identity ( ) const [inherited]

Definition at line 313 of file vgl_h_matrix_2d.txx.

template<class T >
bool vgl_h_matrix_2d< T >::is_rotation ( ) const [inherited]

Definition at line 289 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 [inherited]

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

Definition at line 83 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 [inherited]

assumed to be a point conic.

Definition at line 115 of file vgl_h_matrix_2d.txx.

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

Return the transformed line given by $m = { H}^{-1} l$.

Definition at line 152 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 [inline, inherited]

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

Definition at line 69 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, inherited]

Return the transformed line given by $m = { H}^{-1} l$.

Definition at line 88 of file vgl_h_matrix_2d.h.

template<class T>
vgl_h_matrix_2d<T> vgl_h_matrix_2d< T >::operator* ( vgl_h_matrix_2d< T > const &  H) const [inline, inherited]

composition (*this) * H.

Definition at line 93 of file vgl_h_matrix_2d.h.

template<class T>
bool vgl_h_matrix_2d< T >::operator== ( vgl_h_matrix_2d< T > const &  M) const [inline, inherited]

Definition at line 71 of file vgl_h_matrix_2d.h.

template<class T>
vgl_homg_line_2d< T > vgl_h_matrix_2d< T >::preimage ( vgl_homg_line_2d< T > const &  l) const [inherited]

Return the transformed line given by $m = { H} l$.

Definition at line 99 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 &  q) const [inherited]

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

Definition at line 144 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 [inherited]

assumed to be a point conic.

Definition at line 129 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) [inherited]

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 236 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) [inherited]

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 320 of file vgl_h_matrix_2d.txx.

template<class T >
bool vgl_h_matrix_2d< T >::read ( vcl_istream &  s) [inherited]

Read H from vcl_istream.

Definition at line 165 of file vgl_h_matrix_2d.txx.

template<class T >
bool vgl_h_matrix_2d< T >::read ( char const *  filename) [inherited]

Read H from file.

Definition at line 172 of file vgl_h_matrix_2d.txx.

template<class T >
bool vgl_norm_trans_2d< T >::scale_aniostropic ( vcl_vector< vgl_homg_point_2d< T > > const &  in,
T &  sdx,
T &  sdy,
T &  c,
T &  s 
) [static, protected]

Definition at line 221 of file vgl_norm_trans_2d.txx.

template<class T >
bool vgl_norm_trans_2d< T >::scale_xyroot2 ( vcl_vector< vgl_homg_point_2d< T > > const &  in,
T &  radius 
) [static, protected]

Definition at line 191 of file vgl_norm_trans_2d.txx.

template<class T>
vgl_h_matrix_2d& vgl_h_matrix_2d< T >::set ( unsigned int  row_index,
unsigned int  col_index,
value 
) [inline, inherited]

Set an element of the 3x3 homography matrix.

Definition at line 113 of file vgl_h_matrix_2d.h.

template<class T>
vgl_h_matrix_2d< T > & vgl_h_matrix_2d< T >::set ( T const *  M) [inherited]

Set to 3x3 row-stored matrix.

Definition at line 218 of file vgl_h_matrix_2d.txx.

template<class T>
vgl_h_matrix_2d< T > & vgl_h_matrix_2d< T >::set ( vnl_matrix_fixed< T, 3, 3 > const &  M) [inherited]

Set to given 3x3 matrix.

Definition at line 227 of file vgl_h_matrix_2d.txx.

template<class T>
vgl_h_matrix_2d< T > & vgl_h_matrix_2d< T >::set_affine ( vnl_matrix_fixed< T, 2, 3 > const &  M23) [inherited]

set the transform to a general affine transform matrix.

$A = [ {array}{ccc} a00 & a01 & a02 \% a10 & a11 & a12 \% 0 & 0 & 1 {array}]$

Definition at line 436 of file vgl_h_matrix_2d.txx.

template<class T>
vgl_h_matrix_2d< T > & vgl_h_matrix_2d< T >::set_affine ( vnl_matrix< T > const &  M23) [inherited]
Deprecated:
use the vnl_matrix_fixed variant instead

Definition at line 447 of file vgl_h_matrix_2d.txx.

template<class T>
vgl_h_matrix_2d< T > & vgl_h_matrix_2d< T >::set_aspect_ratio ( aspect_ratio) [inherited]

compose the transform with diagonal aspect ratio transform.

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

Definition at line 426 of file vgl_h_matrix_2d.txx.

template<class T >
vgl_h_matrix_2d< T > & vgl_h_matrix_2d< T >::set_identity ( ) [inherited]

initialize the transformation to identity.

Definition at line 210 of file vgl_h_matrix_2d.txx.

template<class T>
vgl_h_matrix_2d< T > & vgl_h_matrix_2d< T >::set_rotation ( theta) [inherited]

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

rotation angle theta is in radians

Definition at line 392 of file vgl_h_matrix_2d.txx.

template<class T>
vgl_h_matrix_2d< T > & vgl_h_matrix_2d< T >::set_scale ( scale) [inherited]

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

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

Definition at line 403 of file vgl_h_matrix_2d.txx.

template<class T>
vgl_h_matrix_2d< T > & vgl_h_matrix_2d< T >::set_similarity ( s,
theta,
tx,
ty 
) [inherited]

set the transform to a similarity mapping.

Sim $ = [{array}{ccc} () & -() & tx \% () & () & ty \% 0 & 0 & 1 {array}]$

Definition at line 413 of file vgl_h_matrix_2d.txx.

template<class T>
vgl_h_matrix_2d< T > & vgl_h_matrix_2d< T >::set_translation ( tx,
ty 
) [inherited]

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

Definition at line 384 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, inherited]

Definition at line 39 of file vgl_h_matrix_2d.h.


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