CVR-Lib last update 20 Sep 2009

cvr::matrixTransform< I >::matrixTransform::helperBase Class Reference

Base class of helpers. More...

#include <cvrMatrixTransform.h>

Inheritance diagram for cvr::matrixTransform< I >::matrixTransform::helperBase:

Inheritance graph
[legend]
Collaboration diagram for cvr::matrixTransform< I >::matrixTransform::helperBase:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 helperBase (interpolator_type &interp, const parameters &par)
virtual ~helperBase ()
virtual bool analyzeMatrix ()=0
virtual bool apply (const matrix< value_type > &src, matrix< value_type > &dest, fpoint &offset) const =0
virtual void forwards (const fpoint &orig, fpoint &dest, const fpoint &offset) const =0
virtual void backwards (const fpoint &dest, fpoint &orig, const fpoint &offset) const =0
virtual bool evalDims (const ipoint &orig, ipoint &res, fpoint &offset) const =0

Protected Member Functions

bool getDimsFromCorners (const fpoint &tl, const fpoint &tr, const fpoint &bl, const fpoint &br, ipoint &dim, fpoint &offset) const

Protected Attributes

const interpolator_type & interpolator_
const parametersparams_


Detailed Description

template<class I>
class cvr::matrixTransform< I >::helperBase

Base class of helpers.

This is the parent class of all helper classes, each one designed to optimize the computation of the transformation for a particular matrix size.


Constructor & Destructor Documentation

template<class I>
cvr::matrixTransform< I >::matrixTransform::helperBase::helperBase ( interpolator_type &  interp,
const parameters par 
)

The only available constructor forces to provide the interpolator of the enclosing class, which is inherited from the geometricTransform class.

template<class I>
virtual cvr::matrixTransform< I >::matrixTransform::helperBase::~helperBase (  )  [virtual]

Virtual destructor.


Member Function Documentation

template<class I>
virtual bool cvr::matrixTransform< I >::matrixTransform::helperBase::analyzeMatrix (  )  [pure virtual]

template<class I>
virtual bool cvr::matrixTransform< I >::matrixTransform::helperBase::apply ( const matrix< value_type > &  src,
matrix< value_type > &  dest,
fpoint offset 
) const [pure virtual]

Transform an image according to the matrix provided in the parameters.

The offset provides information of the coordinate values of the resulting image with respect to the coordinate system of the original image. Of course, this will be (0,0) if KeepDimensions or KeepOrigin are chosen in the parameter.

If you need to find out where in the rotated image is located the origin of the initial image, then that would be in -offset.

Parameters:
src original image
dest transformed image
offset coordinate in the original reference system of the new image pixel (0,0).

Implemented in cvr::matrixTransform< I >::matrixTransform::helper2x2, cvr::matrixTransform< I >::matrixTransform::helper2x3, cvr::matrixTransform< I >::matrixTransform::helper3x3, and cvr::matrixTransform< I >::matrixTransform::helper4x4.

template<class I>
virtual void cvr::matrixTransform< I >::matrixTransform::helperBase::backwards ( const fpoint dest,
fpoint orig,
const fpoint offset 
) const [pure virtual]

Inverse transform the given point coordinates.

Warning:
Do not forget to provide first the size of the matrix from which the points are going to be taken, using use(const ipoint&).
This method is the inverse of forwards(const fpoint&,fpoint&). Given a position dest in the transformed system, it computes the coordinates of that point in the original coordinate system.

Parameters:
dest Position of a point in the transformed space.
orig Position of the point in the original space.
offset Position of the origin of the result with respect to the coordinate system of the original image.

Implemented in cvr::matrixTransform< I >::matrixTransform::helper2x2, cvr::matrixTransform< I >::matrixTransform::helper2x3, cvr::matrixTransform< I >::matrixTransform::helper3x3, and cvr::matrixTransform< I >::matrixTransform::helper4x4.

template<class I>
virtual bool cvr::matrixTransform< I >::matrixTransform::helperBase::evalDims ( const ipoint orig,
ipoint res,
fpoint offset 
) const [pure virtual]

After the matrix has been analyzed, this method can be used to compute the dimensions of the resulting image and the offset.

If you need to find out where in the rotated image is located the origin of the initial image, then that would be in -offset.

Usually, this method just need to compute the coordinates of the corners internally, optimizing the computation according to the matrix employed, followed by a call the the getDimsFromCorners().

Implemented in cvr::matrixTransform< I >::matrixTransform::helper2x2, cvr::matrixTransform< I >::matrixTransform::helper2x3, cvr::matrixTransform< I >::matrixTransform::helper3x3, cvr::matrixTransform< I >::matrixTransform::helper4x4, and cvr::matrixTransform< I >::matrixTransform::helper4x3.

template<class I>
virtual void cvr::matrixTransform< I >::matrixTransform::helperBase::forwards ( const fpoint orig,
fpoint dest,
const fpoint offset 
) const [pure virtual]

Transform the given point coordinates.

Warning:
Do not forget to provide first the size of the matrix from which the points are going to be taken, using use(const ipoint&).
This method takes the orig position, assumed to be in a reference system of a matrix/image of the size given by the use(const ipoint&) method, and transforms this position according to the set parameters.

Implemented in cvr::matrixTransform< I >::matrixTransform::helper2x2, cvr::matrixTransform< I >::matrixTransform::helper2x3, cvr::matrixTransform< I >::matrixTransform::helper3x3, and cvr::matrixTransform< I >::matrixTransform::helper4x4.

template<class I>
bool cvr::matrixTransform< I >::matrixTransform::helperBase::getDimsFromCorners ( const fpoint tl,
const fpoint tr,
const fpoint bl,
const fpoint br,
ipoint dim,
fpoint offset 
) const [protected]

From the transformed coordinates of the corners, compute the result image dimension and the offset of the origin of that image.

If you need to find out where in the rotated image is located the origin of the initial image, then that would be in -offset.

Returns true if the image size is possible or false if the required size is negative (can happen for KeepOrigin).


Member Data Documentation

template<class I>
const interpolator_type& cvr::matrixTransform< I >::matrixTransform::helperBase::interpolator_ [protected]

Reference to the interpolator object.

template<class I>
const parameters& cvr::matrixTransform< I >::matrixTransform::helperBase::params_ [protected]

Reference to the parameter objects.


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

Generated on Sun Sep 20 22:08:50 2009 for CVR-Lib by Doxygen 1.5.8