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

#include <vgl_algo_fwd.h>

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

Public Member Functions

 vgl_norm_trans_3d ()
 Default constructor. More...
 
 vgl_norm_trans_3d (const vgl_norm_trans_3d< T > &M)
 Copy constructor. More...
 
 vgl_norm_trans_3d (vnl_matrix_fixed< T, 4, 4 > const &M)
 Constructor. More...
 
 vgl_norm_trans_3d (const T *t_matrix)
 Constructor. More...
 
 vgl_norm_trans_3d (std::istream &s)
 Constructor from std::istream. More...
 
 vgl_norm_trans_3d (char const *filename)
 Constructor from file. More...
 
 ~vgl_norm_trans_3d ()
 Destructor. More...
 
bool compute_from_points (std::vector< vgl_homg_point_3d< T > > const &points)
 compute the normalizing transform. More...
 
vgl_homg_point_3d< T > operator() (vgl_homg_point_3d< T > const &p) const
 Return the transformed point given by $q = {\tt H} p$. More...
 
vgl_point_3d< T > operator() (vgl_point_3d< T > const &p) const
 operate directly on Euclidean points for convenience (no ideal points allowed). More...
 
vgl_pointset_3d< T > operator() (vgl_pointset_3d< T > const &ptset) const
 
vgl_homg_plane_3d< T > operator() (vgl_homg_plane_3d< T > const &l) const
 Return the transformed plane given by $m = {\tt H}^{-1} l$. More...
 
vgl_homg_point_3d< T > operator * (vgl_homg_point_3d< T > const &p) const
 Return the transformed point given by $q = {\tt H} p$. More...
 
vgl_point_3d< T > operator * (vgl_point_3d< T > const &p) const
 
vgl_homg_plane_3d< T > operator * (vgl_homg_plane_3d< T > const &l) const
 Return the transformed plane given by $m = {\tt H}^{-1} l$. More...
 
vgl_h_matrix_3d< T > operator * (vgl_h_matrix_3d< T > const &H) const
 composition (*this) * H. More...
 
bool operator== (vgl_h_matrix_3d< T > const &M) const
 
vgl_homg_plane_3d< T > preimage (vgl_homg_plane_3d< T > const &l) const
 Return the preimage of a transformed plane: $m = {\tt H} l$. More...
 
vgl_homg_point_3d< T > preimage (vgl_homg_point_3d< T > const &q) const
 Return the preimage of a transformed point: $p = {\tt H}^{-1} q$. More...
 
vgl_pointset_3d< T > preimage (vgl_pointset_3d< T > const &ptset) const
 
vgl_homg_plane_3d< T > correlation (vgl_homg_point_3d< T > const &p) const
 
vgl_homg_point_3d< T > correlation (vgl_homg_plane_3d< T > const &l) const
 
vnl_matrix_fixed< T, 4, 4 > const & get_matrix () const
 Return the 4x4 homography matrix. More...
 
void get (vnl_matrix_fixed< T, 4, 4 > *M) const
 Fill M with contents of the 4x4 homography matrix. More...
 
void get (vnl_matrix< T > *M) const
 
void get (T *M) const
 Fill M with contents of the 4x4 homography matrix. More...
 
get (unsigned int row_index, unsigned int col_index) const
 Return an element from the 4x4 homography matrix. More...
 
vgl_h_matrix_3d get_inverse () const
 Return the inverse homography. More...
 
vgl_h_matrix_3dset (unsigned int row_index, unsigned int col_index, T value)
 Set an element of the 4x4 homography matrix. More...
 
vgl_h_matrix_3dset (T const *M)
 Set to 4x4 row-stored matrix. More...
 
vgl_h_matrix_3dset (vnl_matrix_fixed< T, 4, 4 > const &M)
 Set to given 4x4 matrix. More...
 
vgl_h_matrix_3dset_identity ()
 initialize the transformation to identity. More...
 
vgl_h_matrix_3dset_translation (T tx, T ty, T tz)
 set H[0][3] = tx, H[1][3] = ty, and H[2][3] = tz, other elements unaltered. More...
 
vgl_h_matrix_3dset_scale (T scale)
 compose the current transform with a uniform scaling transformation, S. More...
 
vgl_h_matrix_3dset_affine (vnl_matrix_fixed< T, 3, 4 > const &M34)
 set the transform to a general affine transform matrix. More...
 
vgl_h_matrix_3dset_rotation_matrix (vnl_matrix_fixed< T, 3, 3 > const &R)
 Just the upper 3x3 part of the matrix is replaced by a rotation matrix. More...
 
vgl_h_matrix_3dset_rotation_about_axis (vnl_vector_fixed< T, 3 > const &axis, T theta)
 Set to rotation about an axis. More...
 
vgl_h_matrix_3dset_rotation_roll_pitch_yaw (T yaw, T pitch, T roll)
 Set to roll, pitch and yaw specified rotation. More...
 
vgl_h_matrix_3dset_rotation_euler (T rz1, T ry, T rz2)
 Set to rotation specified by Euler angles. More...
 
void set_reflection_plane (vgl_plane_3d< double > const &p)
 set the transformation to a reflection about a plane. More...
 
bool is_rotation () const
 
bool is_identity () const
 
bool is_euclidean () const
 
bool is_affine () const
 
bool projective_basis (std::vector< vgl_homg_point_3d< T > > const &five_points)
 Compute transform to projective basis given five points, no 4 of which coplanar. More...
 
bool projective_basis (std::vector< vgl_homg_plane_3d< T > > const &five_planes)
 transformation to projective basis (canonical frame). More...
 
vgl_h_matrix_3d< T > get_upper_3x3 () const
 corresponds to rotation for Euclidean transformations. More...
 
vnl_matrix_fixed< T, 3, 3 > get_upper_3x3_matrix () const
 
vgl_homg_point_3d< T > get_translation () const
 corresponds to translation for affine transformations. More...
 
vnl_vector_fixed< T, 3 > get_translation_vector () const
 
void polar_decomposition (vnl_matrix_fixed< T, 3, 3 > &S, vnl_matrix_fixed< T, 3, 3 > &R) const
 polar decomposition of the upper 3x3 matrix, M = S*R, where S is a symmetric matrix and R is an orthonormal matrix. More...
 
bool read (std::istream &s)
 Load H from ASCII file. More...
 
bool read (char const *filename)
 Read H from file. More...
 

Static Protected Member Functions

static bool scale_xyzroot2 (std::vector< vgl_homg_point_3d< T > > const &in, T &radius)
 
static void center_of_mass (std::vector< vgl_homg_point_3d< T > > const &points, T &cx, T &cy, T &cz)
 

Protected Attributes

vnl_matrix_fixed< T, 4, 4 > t12_matrix_
 

Detailed Description

template<class T>
class vgl_norm_trans_3d< T >

Definition at line 15 of file vgl_algo_fwd.h.

Constructor & Destructor Documentation

◆ vgl_norm_trans_3d() [1/6]

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

Default constructor.

Definition at line 20 of file vgl_norm_trans_3d.hxx.

◆ vgl_norm_trans_3d() [2/6]

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

Copy constructor.

Definition at line 26 of file vgl_norm_trans_3d.hxx.

◆ vgl_norm_trans_3d() [3/6]

template<class T >
vgl_norm_trans_3d< T >::vgl_norm_trans_3d ( vnl_matrix_fixed< T, 4, 4 > const &  M)

Constructor.

Definition at line 49 of file vgl_norm_trans_3d.hxx.

◆ vgl_norm_trans_3d() [4/6]

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

Constructor.

Definition at line 57 of file vgl_norm_trans_3d.hxx.

◆ vgl_norm_trans_3d() [5/6]

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

Constructor from std::istream.

Definition at line 34 of file vgl_norm_trans_3d.hxx.

◆ vgl_norm_trans_3d() [6/6]

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

Constructor from file.

Definition at line 41 of file vgl_norm_trans_3d.hxx.

◆ ~vgl_norm_trans_3d()

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

Destructor.

Member Function Documentation

◆ center_of_mass()

template<class T >
void vgl_norm_trans_3d< T >::center_of_mass ( std::vector< vgl_homg_point_3d< T > > const &  points,
T &  cx,
T &  cy,
T &  cz 
)
staticprotected

Definition at line 100 of file vgl_norm_trans_3d.hxx.

◆ compute_from_points()

template<class T >
bool vgl_norm_trans_3d< T >::compute_from_points ( std::vector< vgl_homg_point_3d< T > > const &  points)

compute the normalizing transform.

Definition at line 76 of file vgl_norm_trans_3d.hxx.

◆ correlation() [1/2]

template<class T >
vgl_homg_plane_3d< T > vgl_h_matrix_3d< T >::correlation ( vgl_homg_point_3d< T > const &  p) const
inherited

Definition at line 134 of file vgl_h_matrix_3d.hxx.

◆ correlation() [2/2]

template<class T >
vgl_homg_point_3d< T > vgl_h_matrix_3d< T >::correlation ( vgl_homg_plane_3d< T > const &  l) const
inherited

Definition at line 150 of file vgl_h_matrix_3d.hxx.

◆ get() [1/4]

template<class T >
void vgl_h_matrix_3d< T >::get ( vnl_matrix_fixed< T, 4, 4 > *  M) const
inherited

Fill M with contents of the 4x4 homography matrix.

Definition at line 215 of file vgl_h_matrix_3d.hxx.

◆ get() [2/4]

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

Definition at line 221 of file vgl_h_matrix_3d.hxx.

◆ get() [3/4]

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

Fill M with contents of the 4x4 homography matrix.

Definition at line 208 of file vgl_h_matrix_3d.hxx.

◆ get() [4/4]

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

Return an element from the 4x4 homography matrix.

Definition at line 202 of file vgl_h_matrix_3d.hxx.

◆ get_inverse()

template<class T >
vgl_h_matrix_3d< T > vgl_h_matrix_3d< T >::get_inverse ( ) const
inherited

Return the inverse homography.

Definition at line 229 of file vgl_h_matrix_3d.hxx.

◆ get_matrix()

template<class T>
vnl_matrix_fixed<T,4,4> const& vgl_h_matrix_3d< T >::get_matrix ( ) const
inlineinherited

Return the 4x4 homography matrix.

Definition at line 106 of file vgl_h_matrix_3d.h.

◆ get_translation()

template<class T >
vgl_homg_point_3d< T > vgl_h_matrix_3d< T >::get_translation ( ) const
inherited

corresponds to translation for affine transformations.

Definition at line 478 of file vgl_h_matrix_3d.hxx.

◆ get_translation_vector()

template<class T >
vnl_vector_fixed< T, 3 > vgl_h_matrix_3d< T >::get_translation_vector ( ) const
inherited

Definition at line 491 of file vgl_h_matrix_3d.hxx.

◆ get_upper_3x3()

template<class T >
vgl_h_matrix_3d< T > vgl_h_matrix_3d< T >::get_upper_3x3 ( ) const
inherited

corresponds to rotation for Euclidean transformations.

Definition at line 439 of file vgl_h_matrix_3d.hxx.

◆ get_upper_3x3_matrix()

template<class T >
vnl_matrix_fixed< T, 3, 3 > vgl_h_matrix_3d< T >::get_upper_3x3_matrix ( ) const
inherited

Definition at line 454 of file vgl_h_matrix_3d.hxx.

◆ is_affine()

template<class T >
bool vgl_h_matrix_3d< T >::is_affine ( ) const
inherited

Definition at line 421 of file vgl_h_matrix_3d.hxx.

◆ is_euclidean()

template<class T >
bool vgl_h_matrix_3d< T >::is_euclidean ( ) const
inherited

Definition at line 402 of file vgl_h_matrix_3d.hxx.

◆ is_identity()

template<class T >
bool vgl_h_matrix_3d< T >::is_identity ( ) const
inherited

Definition at line 431 of file vgl_h_matrix_3d.hxx.

◆ is_rotation()

template<class T >
bool vgl_h_matrix_3d< T >::is_rotation ( ) const
inherited

Definition at line 392 of file vgl_h_matrix_3d.hxx.

◆ operator *() [1/4]

template<class T>
vgl_homg_point_3d<T> vgl_h_matrix_3d< T >::operator * ( vgl_homg_point_3d< T > const &  p) const
inlineinherited

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

Definition at line 66 of file vgl_h_matrix_3d.h.

◆ operator *() [2/4]

template<class T>
vgl_point_3d<T> vgl_h_matrix_3d< T >::operator * ( vgl_point_3d< T > const &  p) const
inlineinherited

Definition at line 81 of file vgl_h_matrix_3d.h.

◆ operator *() [3/4]

template<class T>
vgl_homg_plane_3d<T> vgl_h_matrix_3d< T >::operator * ( vgl_homg_plane_3d< T > const &  l) const
inlineinherited

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

(requires an inverse)

Definition at line 97 of file vgl_h_matrix_3d.h.

◆ operator *() [4/4]

template<class T>
vgl_h_matrix_3d<T> vgl_h_matrix_3d< T >::operator * ( vgl_h_matrix_3d< T > const &  H) const
inlineinherited

composition (*this) * H.

Definition at line 100 of file vgl_h_matrix_3d.h.

◆ operator()() [1/4]

template<class T >
vgl_homg_point_3d< T > vgl_h_matrix_3d< T >::operator() ( vgl_homg_point_3d< T > const &  p) const
inherited

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

Definition at line 100 of file vgl_h_matrix_3d.hxx.

◆ operator()() [2/4]

template<class T>
vgl_point_3d<T> vgl_h_matrix_3d< T >::operator() ( vgl_point_3d< T > const &  p) const
inlineinherited

operate directly on Euclidean points for convenience (no ideal points allowed).

Definition at line 78 of file vgl_h_matrix_3d.h.

◆ operator()() [3/4]

template<class T >
vgl_pointset_3d< T > vgl_h_matrix_3d< T >::operator() ( vgl_pointset_3d< T > const &  ptset) const
inherited

Definition at line 107 of file vgl_h_matrix_3d.hxx.

◆ operator()() [4/4]

template<class T >
vgl_homg_plane_3d< T > vgl_h_matrix_3d< T >::operator() ( vgl_homg_plane_3d< T > const &  l) const
inherited

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

(requires an inverse)

Definition at line 171 of file vgl_h_matrix_3d.hxx.

◆ operator==()

template<class T>
bool vgl_h_matrix_3d< T >::operator== ( vgl_h_matrix_3d< T > const &  M) const
inlineinherited

Definition at line 68 of file vgl_h_matrix_3d.h.

◆ polar_decomposition()

template<class T >
void vgl_h_matrix_3d< T >::polar_decomposition ( vnl_matrix_fixed< T, 3, 3 > &  S,
vnl_matrix_fixed< T, 3, 3 > &  R 
) const
inherited

polar decomposition of the upper 3x3 matrix, M = S*R, where S is a symmetric matrix and R is an orthonormal matrix.

useful for interpreting affine transformations

Definition at line 464 of file vgl_h_matrix_3d.hxx.

◆ preimage() [1/3]

template<class T >
vgl_homg_plane_3d< T > vgl_h_matrix_3d< T >::preimage ( vgl_homg_plane_3d< T > const &  l) const
inherited

Return the preimage of a transformed plane: $m = {\tt H} l$.

Definition at line 142 of file vgl_h_matrix_3d.hxx.

◆ preimage() [2/3]

template<class T >
vgl_homg_point_3d< T > vgl_h_matrix_3d< T >::preimage ( vgl_homg_point_3d< T > const &  q) const
inherited

Return the preimage of a transformed point: $p = {\tt H}^{-1} q$.

(requires an inverse)

Definition at line 158 of file vgl_h_matrix_3d.hxx.

◆ preimage() [3/3]

template<class T >
vgl_pointset_3d< T > vgl_h_matrix_3d< T >::preimage ( vgl_pointset_3d< T > const &  ptset) const
inherited

Definition at line 164 of file vgl_h_matrix_3d.hxx.

◆ projective_basis() [1/2]

template<class T >
bool vgl_h_matrix_3d< T >::projective_basis ( std::vector< vgl_homg_point_3d< T > > const &  five_points)
inherited

Compute transform to projective basis given five points, no 4 of which coplanar.

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: $\begin{array}{cccc} p[0] & p[1] & p[2] & p[3] & p[4] \% 1 & 0 & 0 & 0 & 1 \% 0 & 1 & 0 & 0 & 1 \% 0 & 0 & 1 & 0 & 1 \% 0 & 0 & 0 & 1 & 1 \end{array}$

Definition at line 252 of file vgl_h_matrix_3d.hxx.

◆ projective_basis() [2/2]

template<class T >
bool vgl_h_matrix_3d< T >::projective_basis ( std::vector< vgl_homg_plane_3d< T > > const &  five_planes)
inherited

transformation to projective basis (canonical frame).

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

Definition at line 259 of file vgl_h_matrix_3d.hxx.

◆ read() [1/2]

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

Load H from ASCII file.

Definition at line 184 of file vgl_h_matrix_3d.hxx.

◆ read() [2/2]

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

Read H from file.

Definition at line 191 of file vgl_h_matrix_3d.hxx.

◆ scale_xyzroot2()

template<class T >
bool vgl_norm_trans_3d< T >::scale_xyzroot2 ( std::vector< vgl_homg_point_3d< T > > const &  in,
T &  radius 
)
staticprotected

Definition at line 139 of file vgl_norm_trans_3d.hxx.

◆ set() [1/3]

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

Set an element of the 4x4 homography matrix.

Definition at line 120 of file vgl_h_matrix_3d.h.

◆ set() [2/3]

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

Set to 4x4 row-stored matrix.

Definition at line 236 of file vgl_h_matrix_3d.hxx.

◆ set() [3/3]

template<class T >
vgl_h_matrix_3d< T > & vgl_h_matrix_3d< T >::set ( vnl_matrix_fixed< T, 4, 4 > const &  M)
inherited

Set to given 4x4 matrix.

Definition at line 245 of file vgl_h_matrix_3d.hxx.

◆ set_affine()

template<class T >
vgl_h_matrix_3d< T > & vgl_h_matrix_3d< T >::set_affine ( vnl_matrix_fixed< T, 3, 4 > const &  M34)
inherited

set the transform to a general affine transform matrix.

$A = \left[ \begin{array}{ccc} a00 & a01 & a02 & a03 \% a10 & a11 & a12 & a13 \% a20 & a21 & a22 & a23 \% 0 & 0 & 0 & 1 \end{array}\right]$

Definition at line 295 of file vgl_h_matrix_3d.hxx.

◆ set_identity()

template<class T >
vgl_h_matrix_3d< T > & vgl_h_matrix_3d< T >::set_identity ( )
inherited

initialize the transformation to identity.

Definition at line 267 of file vgl_h_matrix_3d.hxx.

◆ set_reflection_plane()

template<class T >
void vgl_h_matrix_3d< T >::set_reflection_plane ( vgl_plane_3d< double > const &  p)
inherited

set the transformation to a reflection about a plane.

Definition at line 371 of file vgl_h_matrix_3d.hxx.

◆ set_rotation_about_axis()

template<class T >
vgl_h_matrix_3d< T > & vgl_h_matrix_3d< T >::set_rotation_about_axis ( vnl_vector_fixed< T, 3 > const &  axis,
theta 
)
inherited

Set to rotation about an axis.

Just the upper 3x3 part of the matrix is replaced by a rotation matrix. rotation angle theta is in radians

Definition at line 306 of file vgl_h_matrix_3d.hxx.

◆ set_rotation_euler()

template<class T >
vgl_h_matrix_3d< T > & vgl_h_matrix_3d< T >::set_rotation_euler ( rz1,
ry,
rz2 
)
inherited

Set to rotation specified by Euler angles.

Just the upper 3x3 part of the matrix is replaced by a rotation matrix.

Definition at line 340 of file vgl_h_matrix_3d.hxx.

◆ set_rotation_matrix()

template<class T >
vgl_h_matrix_3d< T > & vgl_h_matrix_3d< T >::set_rotation_matrix ( vnl_matrix_fixed< T, 3, 3 > const &  R)
inherited

Just the upper 3x3 part of the matrix is replaced by a rotation matrix.

Definition at line 360 of file vgl_h_matrix_3d.hxx.

◆ set_rotation_roll_pitch_yaw()

template<class T >
vgl_h_matrix_3d< T > & vgl_h_matrix_3d< T >::set_rotation_roll_pitch_yaw ( yaw,
pitch,
roll 
)
inherited

Set to roll, pitch and yaw specified rotation.

  • roll is rotation about z
  • pitch is rotation about y
  • yaw is rotation about x Just the upper 3x3 part of the matrix is replaced by a rotation matrix.

Definition at line 320 of file vgl_h_matrix_3d.hxx.

◆ set_scale()

template<class T >
vgl_h_matrix_3d< T > & vgl_h_matrix_3d< T >::set_scale ( scale)
inherited

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

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

Definition at line 285 of file vgl_h_matrix_3d.hxx.

◆ set_translation()

template<class T >
vgl_h_matrix_3d< T > & vgl_h_matrix_3d< T >::set_translation ( tx,
ty,
tz 
)
inherited

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

Definition at line 275 of file vgl_h_matrix_3d.hxx.

Member Data Documentation

◆ t12_matrix_

template<class T>
vnl_matrix_fixed<T,4,4> vgl_h_matrix_3d< T >::t12_matrix_
protectedinherited

Definition at line 40 of file vgl_h_matrix_3d.h.


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