CVR-Lib last update 20 Sep 2009

cvr::bilinearInterpolation< T > Class Template Reference

This functor use bilinear interpolation to approximate values between the pixels or elements of vectors and matrices. More...

#include <cvrBilinearInterpolation.h>

Inheritance diagram for cvr::bilinearInterpolation< T >:

Inheritance graph
[legend]
Collaboration diagram for cvr::bilinearInterpolation< T >:

Collaboration graph
[legend]

List of all members.

Classes

class  parameters
 The parameters for the class bilinearInterpolation. More...

Public Member Functions

 bilinearInterpolation ()
 bilinearInterpolation (const eBoundaryType boundaryType)
 bilinearInterpolation (const parameters &par)
 bilinearInterpolation (const bilinearInterpolation< T > &other)
virtual ~bilinearInterpolation ()
virtual const std::string & name () const
virtual T apply (const vector< T > &src, const float &x) const
virtual T apply (const float &x) const
virtual T apply (const matrix< T > &src, const float &row, const float &col) const
virtual T apply (const matrix< T > &src, const point< float > &p) const
virtual T apply (const float &row, const float &col) const
virtual T apply (const point< float > &p) const
interpolate (const matrix< T > &src, const float row, const float col) const
interpolate (const float row, const float col) const
interpolateUnchk (const matrix< T > &src, const float row, const float col) const
interpolateUnchk (const float row, const float col) const
compute (const float fy, const float fx, const T syx, const T syx1, const T sy1x, const T sy1x1) const
compute (const float fx, const T sx, const T sx1) const
bilinearInterpolation< T > & copy (const bilinearInterpolation< T > &other)
bilinearInterpolation< T > & operator= (const bilinearInterpolation< T > &other)
virtual bilinearInterpolation
< T > * 
clone () const
virtual bilinearInterpolation
< T > * 
newInstance () const
const parametersgetParameters () const
int getRangeOfInfluence () const


Detailed Description

template<typename T>
class cvr::bilinearInterpolation< T >

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.


Constructor & Destructor Documentation

template<typename T>
cvr::bilinearInterpolation< T >::bilinearInterpolation (  ) 

Default constructor.

template<typename T>
cvr::bilinearInterpolation< T >::bilinearInterpolation ( const eBoundaryType  boundaryType  ) 

Construct an interpolation with the given boundary type.

template<typename T>
cvr::bilinearInterpolation< T >::bilinearInterpolation ( const parameters par  ) 

Construct a functor using the given parameters.

template<typename T>
cvr::bilinearInterpolation< T >::bilinearInterpolation ( const bilinearInterpolation< T > &  other  ) 

Copy constructor.

Parameters:
other the object to be copied

template<typename T>
virtual cvr::bilinearInterpolation< T >::~bilinearInterpolation (  )  [virtual]

Destructor.


Member Function Documentation

template<typename T>
virtual T cvr::bilinearInterpolation< T >::apply ( const point< float > &  p  )  const [virtual]

Returns the interpolated value of the matrix specified with use() at the real valued position p.

Parameters:
p the real valued position to be interpolated.
Returns:
the interpolated value of the matrix.

Implements cvr::fixedGridInterpolation< T >.

template<typename T>
virtual T cvr::bilinearInterpolation< 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).

Parameters:
row which row
col which column
Returns:
the interpolated value of the matrix.

Implements cvr::fixedGridInterpolation< T >.

template<typename T>
virtual T cvr::bilinearInterpolation< T >::apply ( const matrix< T > &  src,
const point< float > &  p 
) const [virtual]

Returns the interpolated value of the matrix at the real valued position p.

Parameters:
src matrix<T> with the source data.
p the real valued position to be interpolated.
Returns:
the interpolated value of the matrix.

Implements cvr::fixedGridInterpolation< T >.

template<typename T>
virtual T cvr::bilinearInterpolation< 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).

Parameters:
src matrix<T> with the source data.
row which row
col which column
Returns:
the interpolated value of the matrix.

Implements cvr::fixedGridInterpolation< T >.

template<typename T>
virtual T cvr::bilinearInterpolation< T >::apply ( const float &  x  )  const [virtual]

Returns the interpolated value of the vector specified with use() at the real valued position x.

Parameters:
x the real valued position to be interpolated.
Returns:
the interpolated value of the vector.

Implements cvr::fixedGridInterpolation< T >.

template<typename T>
virtual T cvr::bilinearInterpolation< T >::apply ( const vector< T > &  src,
const float &  x 
) const [virtual]

Returns the interpolated value of the vector at the real valued position x.

Parameters:
src vector<T> with the source data.
x the real valued position to be interpolated.
Returns:
the interpolated value of the vector.

Implements cvr::fixedGridInterpolation< T >.

template<typename T>
virtual bilinearInterpolation<T>* cvr::bilinearInterpolation< T >::clone (  )  const [virtual]

Returns a pointer to a clone of this functor.

Implements cvr::functor.

template<typename T>
T cvr::bilinearInterpolation< 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.

Parameters:
fx fractional term between 0 and 1
sx value for sx==0
sx1 value for sx==1
Returns:
interpolated value between the two extremes.

template<typename T>
T cvr::bilinearInterpolation< 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.

Parameters:
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
Returns:
interpolated value between the four corners

template<typename T>
bilinearInterpolation<T>& cvr::bilinearInterpolation< T >::copy ( const bilinearInterpolation< T > &  other  ) 

Copy data of "other" functor.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

template<typename T>
const parameters& cvr::bilinearInterpolation< T >::getParameters (  )  const

Returns used parameters.

Reimplemented from cvr::fixedGridInterpolation< T >.

template<typename T>
int cvr::bilinearInterpolation< T >::getRangeOfInfluence (  )  const [virtual]

This method returns which pixel range around the interpolated postition is considered by the interpolation functor.

This is very useful for other functors to decide whether they should call the interpolate() methods or the faster interpolateUnchk() methods.

If the returned value is a and the interpolated position is (x,y) all pixels with coordinates in $ [x-a .. x+a] \times [y-a .. y+a] $ may be considered by the interpolation functor.

Implements cvr::fixedGridInterpolation< T >.

template<typename T>
T cvr::bilinearInterpolation< 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

Parameters:
row which row
col which column
Returns:
the interpolated value of the matrix.

template<typename T>
T cvr::bilinearInterpolation< 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

Parameters:
src matrix<T> with the source data.
row which row
col which column
Returns:
the interpolated value of the matrix.

template<typename T>
T cvr::bilinearInterpolation< 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

Parameters:
row which row
col which column
Returns:
the interpolated value of the matrix.

template<typename T>
T cvr::bilinearInterpolation< 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.

Parameters:
src matrix<T> with the source data.
row which row
col which column
Returns:
the interpolated value of the matrix.

template<typename T>
virtual const std::string& cvr::bilinearInterpolation< T >::name (  )  const [virtual]

Returns the name of this type.

Reimplemented from cvr::fixedGridInterpolation< T >.

template<typename T>
virtual bilinearInterpolation<T>* cvr::bilinearInterpolation< T >::newInstance (  )  const [virtual]

Returns a pointer to a new instance of this functor.

Implements cvr::functor.

template<typename T>
bilinearInterpolation<T>& cvr::bilinearInterpolation< T >::operator= ( const bilinearInterpolation< T > &  other  ) 

Alias for copy member.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object


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

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