latest version v1.9 - last update 10 Apr 2010 |
This functor use bilinear interpolation to approximate values between the pixels or elements of vectors and matrices. More...
#include <ltiBilinearInterpolator.h>
Public Member Functions | |
bilinearInterpolator () | |
bilinearInterpolator (const eBoundaryType boundaryType) | |
bilinearInterpolator (const bilinearInterpolator< T > &other) | |
virtual | ~bilinearInterpolator () |
virtual const char * | getTypeName () const |
T | apply (const vector< T > &src, const float &x) const |
T | apply (const float &x) const |
T | apply (const matrix< T > &src, const float &row, const float &col) const |
T | apply (const matrix< T > &src, const tpoint< float > &p) const |
T | apply (const float &row, const float &col) const |
T | apply (const tpoint< float > &p) const |
T | interpolate (const matrix< T > &src, const float row, const float col) const |
T | interpolate (const float row, const float col) const |
T | interpolateUnchk (const matrix< T > &src, const float row, const float col) const |
T | interpolateUnchk (const float row, const float col) const |
bilinearInterpolator & | copy (const bilinearInterpolator &other) |
virtual functor * | clone () const |
const parameters & | getParameters () const |
T | compute (const float fy, const float fx, const T syx, const T syx1, const T sy1x, const T sy1x1) const |
T | compute (const float fx, const T sx, const T sx1) const |
This functor use bilinear interpolation to approximate values between the pixels or elements of vectors and matrices.
The type T of the template is the type of the elements of the vector or matrix used.
lti::bilinearInterpolator< T >::bilinearInterpolator | ( | ) |
default constructor
lti::bilinearInterpolator< T >::bilinearInterpolator | ( | const eBoundaryType | boundaryType | ) |
Construct an interpolator with the given boundary type.
lti::bilinearInterpolator< T >::bilinearInterpolator | ( | const bilinearInterpolator< T > & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::bilinearInterpolator< T >::~bilinearInterpolator | ( | ) | [virtual] |
destructor
T lti::bilinearInterpolator< T >::apply | ( | const tpoint< float > & | p | ) | const [virtual] |
Returns the interpolated value of the matrix specified with use() at the real valued position p.
p | the real valued position to be interpolated. |
Implements lti::scalarValuedInterpolation< T >.
T lti::bilinearInterpolator< T >::apply | ( | const float & | row, | |
const float & | col | |||
) | const [virtual] |
Returns the interpolated value of the matrix specified with use() at the real valued position (row,col).
row | which row | |
col | which column |
Implements lti::scalarValuedInterpolation< T >.
T lti::bilinearInterpolator< T >::apply | ( | const matrix< T > & | src, | |
const tpoint< float > & | p | |||
) | const [virtual] |
Returns the interpolated value of the matrix at the real valued position p.
src | matrix<T> with the source data. | |
p | the real valued position to be interpolated. |
Implements lti::scalarValuedInterpolation< T >.
T lti::bilinearInterpolator< T >::apply | ( | const matrix< T > & | src, | |
const float & | row, | |||
const float & | col | |||
) | const [virtual] |
Returns the interpolated value of the matrix at the real valued position (row,col).
src | matrix<T> with the source data. | |
row | which row | |
col | which column |
Implements lti::scalarValuedInterpolation< T >.
T lti::bilinearInterpolator< T >::apply | ( | const float & | x | ) | const [virtual] |
Returns the interpolated value of the vector specified with use() at the real valued position x.
x | the real valued position to be interpolated. |
Implements lti::scalarValuedInterpolation< T >.
T lti::bilinearInterpolator< T >::apply | ( | const vector< T > & | src, | |
const float & | x | |||
) | const [virtual] |
Returns the interpolated value of the vector at the real valued position x.
src | vector<T> with the source data. | |
x | the real valued position to be interpolated. |
Implements lti::scalarValuedInterpolation< T >.
virtual functor* lti::bilinearInterpolator< T >::clone | ( | ) | const [virtual] |
returns a pointer to a clone of this functor.
Implements lti::scalarValuedInterpolation< T >.
T lti::bilinearInterpolator< T >::compute | ( | const float | fx, | |
const T | sx, | |||
const T | sx1 | |||
) | const [inline] |
Compute the linear interpolated value for the given coefficients and values.
This method is provided for convenience only. Use at your own risk.
fx | fractional term between 0 and 1 | |
sx | value for sx==0 | |
sx1 | value for sx==1 |
T lti::bilinearInterpolator< T >::compute | ( | const float | fy, | |
const float | fx, | |||
const T | syx, | |||
const T | syx1, | |||
const T | sy1x, | |||
const T | sy1x1 | |||
) | const [inline] |
Compute the bilinear interpolated value for the given coefficients and values.
This method is provided for convenience only. Use at your own risk.
fy | fractional term between 0 and 1 | |
fx | fractional term between 0 and 1 | |
syx | value for fx==0 fy==0 | |
syx1 | value for fx==1 fy==0 | |
sy1x | value for fx==0 fy==1 | |
sy1x1 | value for fx==1 fy==1 |
Referenced by lti::bilinearInterpolator< T >::interpolateUnchk().
bilinearInterpolator& lti::bilinearInterpolator< T >::copy | ( | const bilinearInterpolator< T > & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::scalarValuedInterpolation< T >.
const parameters& lti::bilinearInterpolator< T >::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::scalarValuedInterpolation< T >.
virtual const char* lti::bilinearInterpolator< T >::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("bilinearInterpolator")
Reimplemented from lti::scalarValuedInterpolation< T >.
T lti::bilinearInterpolator< T >::interpolate | ( | const float | row, | |
const float | col | |||
) | const [inline] |
Returns the interpolated value of the matrix specified with use() at the real valued position (row,col).
This method is not virtual and can be used if this interpolation type is used as template parameter in time critical situations
row | which row | |
col | which column |
T lti::bilinearInterpolator< T >::interpolate | ( | const matrix< T > & | src, | |
const float | row, | |||
const float | col | |||
) | const |
Returns the interpolated value of the matrix at the real valued position (row,col).
This method is not virtual and can be used if this interpolation type is used as template parameter in time critical situations
src | matrix<T> with the source data. | |
row | which row | |
col | which column |
Referenced by lti::bilinearInterpolator< ubyte >::interpolate().
T lti::bilinearInterpolator< T >::interpolateUnchk | ( | const float | row, | |
const float | col | |||
) | const [inline] |
Returns the interpolated value of the matrix specified with use() at the real valued position (row,col).
This method is not virtual and can be used if this interpolation type is used as template parameter in time critical situations
row | which row | |
col | which column |
References lti::bilinearInterpolator< T >::interpolateUnchk(), and lti::scalarValuedInterpolation< T >::theMatrix.
T lti::bilinearInterpolator< T >::interpolateUnchk | ( | const matrix< T > & | src, | |
const float | row, | |||
const float | col | |||
) | const [inline] |
Returns the interpolated value of the matrix at the real valued position (row,col).
This method does not check if the given coordinates and the rest of used points in the src matrix lie within the valid range. This is left to you. Please consider that for the bilinear interpolation not only the point(trunc(col),trunc(row)) is used, but also its three "next" neighbors ((col,row+1),(col+1,row),(col+1,row+1)).
This method is not virtual and can be used in time critical situations, where you prefer to take the boundary control by yourself.
src | matrix<T> with the source data. | |
row | which row | |
col | which column |
References lti::genericMatrix< T >::at(), and lti::bilinearInterpolator< T >::compute().
Referenced by lti::bilinearInterpolator< T >::interpolateUnchk().