Public Types | Public Member Functions | Private Attributes
HMatrix2D Class Reference

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

#include <HMatrix2D.h>

List of all members.

Public Types

enum  Type { Euclidean, Similarity, Affine, Projective }
 Flags for reduced H matrices. More...

Public Member Functions

 HMatrix2D ()
 Default constructor.
 HMatrix2D (const HMatrix2D &M)
 Copy constructor.
 HMatrix2D (vnl_double_3x3 const &M)
 Constructor.
 HMatrix2D (const double *t_matrix)
 Constructor.
 HMatrix2D (vcl_istream &s)
 Constructor from vcl_istream.
 HMatrix2D (char const *filename)
 Constructor from file.
 ~HMatrix2D ()
 Destructor.
HomgPoint2D transform_to_plane2 (const HomgPoint2D &x1) const
 Return the transformed point given by $ x_2 = { H} x_1 $.
vgl_homg_point_2d< double > transform_to_plane2 (vgl_homg_point_2d< double > const &x1) const
HomgLine2D transform_to_plane1 (const HomgLine2D &l2) const
 Return the transformed line given by $ l_1 = { H}^ l_2 $.
vgl_homg_line_2d< double > transform_to_plane1 (vgl_homg_line_2d< double > const &l2) const
HomgLine2D transform_to_plane2 (const HomgLine2D &l1) const
 Return the transformed line $l_2$ given by $l_1=H^ l_2$.
vgl_homg_line_2d< double > transform_to_plane2 (vgl_homg_line_2d< double > const &l1) const
HomgPoint2D transform_to_plane1 (const HomgPoint2D &x2) const
 Return the transformed point $x_1$ given by $x_2 = H \, x_1$.
vgl_homg_point_2d< double > transform_to_plane1 (vgl_homg_point_2d< double > const &x2) const
HomgPoint2D operator* (const HomgPoint2D &x1) const
vgl_homg_point_2d< double > operator* (vgl_homg_point_2d< double > const &x1) const
HomgPoint2D operator() (const HomgPoint2D &p) const
vgl_homg_point_2d< double > operator() (vgl_homg_point_2d< double > const &p) const
HomgLine2D preimage (const HomgLine2D &l) const
vgl_homg_line_2d< double > preimage (vgl_homg_line_2d< double > const &l) const
HomgPoint2D preimage (const HomgPoint2D &p) const
vgl_homg_point_2d< double > preimage (vgl_homg_point_2d< double > const &p) const
HomgLine2D operator() (const HomgLine2D &l) const
vgl_homg_line_2d< double > operator() (vgl_homg_line_2d< double > const &l) const
vnl_double_4 transform_bounding_box (double x0, double y0, double x1, double y1)
 Return new axis-aligned bounding box after (x0,y0) -> (x1,y1) have been pre-multiplied by H.
HMatrix2D operator* (const HMatrix2D &H2)
 Composition.
double get (unsigned int row_index, unsigned int col_index) const
 Get matrix element at (row_index, col_index).
void get (double *t_matrix) const
 Fill H with contents of this.
void get (vnl_matrix< double > *t_matrix) const
 Fill H with contents of this.
const vnl_double_3x3get_matrix () const
HMatrix2D get_inverse () const
 Return inverse of this homography.
void set_identity ()
 Set to identity.
void set (const double *t_matrix)
 Set to 3x3 row-stored matrix.
void set (vnl_double_3x3 const &t_matrix)
 Set to given vnl_matrix.
bool read (vcl_istream &s)
 Read H from vcl_istream.
bool read (char const *filename)
 Read H from file.

Private Attributes

vnl_double_3x3 t12_matrix_

Detailed Description

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 34 of file HMatrix2D.h.


Member Enumeration Documentation

Flags for reduced H matrices.

Enumerator:
Euclidean 
Similarity 
Affine 
Projective 

Definition at line 42 of file HMatrix2D.h.


Constructor & Destructor Documentation

HMatrix2D::HMatrix2D ( )

Default constructor.

Definition at line 16 of file HMatrix2D.cxx.

HMatrix2D::HMatrix2D ( const HMatrix2D M)

Copy constructor.

Definition at line 21 of file HMatrix2D.cxx.

HMatrix2D::HMatrix2D ( vnl_double_3x3 const &  M)

Constructor.

Definition at line 46 of file HMatrix2D.cxx.

HMatrix2D::HMatrix2D ( const double *  t_matrix)

Constructor.

Definition at line 54 of file HMatrix2D.cxx.

HMatrix2D::HMatrix2D ( vcl_istream &  s)

Constructor from vcl_istream.

Definition at line 28 of file HMatrix2D.cxx.

HMatrix2D::HMatrix2D ( char const *  filename)

Constructor from file.

Definition at line 34 of file HMatrix2D.cxx.

HMatrix2D::~HMatrix2D ( )

Destructor.

Definition at line 60 of file HMatrix2D.cxx.


Member Function Documentation

double HMatrix2D::get ( unsigned int  row_index,
unsigned int  col_index 
) const

Get matrix element at (row_index, col_index).

Definition at line 144 of file HMatrix2D.cxx.

void HMatrix2D::get ( double *  t_matrix) const

Fill H with contents of this.

Definition at line 150 of file HMatrix2D.cxx.

void HMatrix2D::get ( vnl_matrix< double > *  t_matrix) const

Fill H with contents of this.

Definition at line 158 of file HMatrix2D.cxx.

HMatrix2D HMatrix2D::get_inverse ( ) const

Return inverse of this homography.

Definition at line 184 of file HMatrix2D.cxx.

const vnl_double_3x3& HMatrix2D::get_matrix ( ) const [inline]

Definition at line 100 of file HMatrix2D.h.

HomgPoint2D HMatrix2D::operator() ( const HomgPoint2D p) const [inline]

Definition at line 79 of file HMatrix2D.h.

vgl_homg_point_2d<double> HMatrix2D::operator() ( vgl_homg_point_2d< double > const &  p) const [inline]

Definition at line 80 of file HMatrix2D.h.

HomgLine2D HMatrix2D::operator() ( const HomgLine2D l) const [inline]

Definition at line 87 of file HMatrix2D.h.

vgl_homg_line_2d<double> HMatrix2D::operator() ( vgl_homg_line_2d< double > const &  l) const [inline]

Definition at line 88 of file HMatrix2D.h.

HomgPoint2D HMatrix2D::operator* ( const HomgPoint2D x1) const [inline]

Definition at line 77 of file HMatrix2D.h.

vgl_homg_point_2d<double> HMatrix2D::operator* ( vgl_homg_point_2d< double > const &  x1) const [inline]

Definition at line 78 of file HMatrix2D.h.

HMatrix2D HMatrix2D::operator* ( const HMatrix2D H2) [inline]

Composition.

Definition at line 93 of file HMatrix2D.h.

HomgLine2D HMatrix2D::preimage ( const HomgLine2D l) const [inline]

Definition at line 81 of file HMatrix2D.h.

vgl_homg_line_2d<double> HMatrix2D::preimage ( vgl_homg_line_2d< double > const &  l) const [inline]

Definition at line 82 of file HMatrix2D.h.

HomgPoint2D HMatrix2D::preimage ( const HomgPoint2D p) const [inline]

Definition at line 85 of file HMatrix2D.h.

vgl_homg_point_2d<double> HMatrix2D::preimage ( vgl_homg_point_2d< double > const &  p) const [inline]

Definition at line 86 of file HMatrix2D.h.

bool HMatrix2D::read ( vcl_istream &  s)

Read H from vcl_istream.

Definition at line 126 of file HMatrix2D.cxx.

bool HMatrix2D::read ( char const *  filename)

Read H from file.

Definition at line 132 of file HMatrix2D.cxx.

void HMatrix2D::set ( const double *  t_matrix)

Set to 3x3 row-stored matrix.

Definition at line 170 of file HMatrix2D.cxx.

void HMatrix2D::set ( vnl_double_3x3 const &  t_matrix)

Set to given vnl_matrix.

Definition at line 178 of file HMatrix2D.cxx.

void HMatrix2D::set_identity ( )

Set to identity.

Definition at line 164 of file HMatrix2D.cxx.

vnl_double_4 HMatrix2D::transform_bounding_box ( double  x0,
double  y0,
double  x1,
double  y1 
)

Return new axis-aligned bounding box after (x0,y0) -> (x1,y1) have been pre-multiplied by H.

Definition at line 190 of file HMatrix2D.cxx.

HomgLine2D HMatrix2D::transform_to_plane1 ( const HomgLine2D l2) const

Return the transformed line given by $ l_1 = { H}^ l_2 $.

Definition at line 80 of file HMatrix2D.cxx.

vgl_homg_line_2d<double> HMatrix2D::transform_to_plane1 ( vgl_homg_line_2d< double > const &  l2) const [inline]

Definition at line 66 of file HMatrix2D.h.

HomgPoint2D HMatrix2D::transform_to_plane1 ( const HomgPoint2D x2) const

Return the transformed point $x_1$ given by $x_2 = H \, x_1$.

Note that this calculates the inverse of $H$ on every call.

Definition at line 89 of file HMatrix2D.cxx.

vgl_homg_point_2d<double> HMatrix2D::transform_to_plane1 ( vgl_homg_point_2d< double > const &  x2) const [inline]

Definition at line 74 of file HMatrix2D.h.

HomgPoint2D HMatrix2D::transform_to_plane2 ( const HomgPoint2D x1) const

Return the transformed point given by $ x_2 = { H} x_1 $.

Definition at line 70 of file HMatrix2D.cxx.

vgl_homg_point_2d<double> HMatrix2D::transform_to_plane2 ( vgl_homg_point_2d< double > const &  x1) const [inline]

Definition at line 63 of file HMatrix2D.h.

HomgLine2D HMatrix2D::transform_to_plane2 ( const HomgLine2D l1) const

Return the transformed line $l_2$ given by $l_1=H^ l_2$.

Note that this calculates the inverse of $H$ on every call.

Definition at line 104 of file HMatrix2D.cxx.

vgl_homg_line_2d<double> HMatrix2D::transform_to_plane2 ( vgl_homg_line_2d< double > const &  l1) const [inline]

Definition at line 70 of file HMatrix2D.h.


Member Data Documentation

Definition at line 37 of file HMatrix2D.h.


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