last update 20 Sep 2009 |
#include <cvrMatrixTransform.h>
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 parameters & | params_ |
This is the parent class of all helper classes, each one designed to optimize the computation of the transformation for a particular matrix size.
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.
virtual cvr::matrixTransform< I >::matrixTransform::helperBase::~helperBase | ( | ) | [virtual] |
Virtual destructor.
virtual bool cvr::matrixTransform< I >::matrixTransform::helperBase::analyzeMatrix | ( | ) | [pure virtual] |
Analyze the matrix in the parameters and compute its inverse.
If the matrix is not invertible, then return false.
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.
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.
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.
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.
dest
in the transformed system, it computes the coordinates of that point in the original coordinate system.
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.
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.
virtual void cvr::matrixTransform< I >::matrixTransform::helperBase::forwards | ( | const fpoint & | orig, | |
fpoint & | dest, | |||
const fpoint & | offset | |||
) | const [pure virtual] |
Transform the given point coordinates.
Implemented in cvr::matrixTransform< I >::matrixTransform::helper2x2, cvr::matrixTransform< I >::matrixTransform::helper2x3, cvr::matrixTransform< I >::matrixTransform::helper3x3, and cvr::matrixTransform< I >::matrixTransform::helper4x4.
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).
const interpolator_type& cvr::matrixTransform< I >::matrixTransform::helperBase::interpolator_ [protected] |
Reference to the interpolator object.
const parameters& cvr::matrixTransform< I >::matrixTransform::helperBase::params_ [protected] |
Reference to the parameter objects.