CVR-Lib last update 20 Sep 2009

cvr::nearestNeighborInterpolation< T > Class Template Reference

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

#include <cvrNearestNeighborInterpolation.h>

Inheritance diagram for cvr::nearestNeighborInterpolation< T >:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 nearestNeighborInterpolation ()
 nearestNeighborInterpolation (const eBoundaryType boundaryType)
 nearestNeighborInterpolation (const nearestNeighborInterpolation< T > &other)
virtual ~nearestNeighborInterpolation ()
int getRangeOfInfluence () const
virtual const std::string & name () const
apply (const vector< T > &src, const float &x) const
apply (const float &x) const
apply (const matrix< T > &src, const float &row, const float &col) const
apply (const matrix< T > &src, const point< float > &p) const
apply (const float &row, const float &col) const
apply (const point< float > &p) const
interpolate (const matrix< T > &src, const float row, const float col) const
interpolateUnchk (const matrix< T > &src, const float row, const float col) const
nearestNeighborInterpolationcopy (const nearestNeighborInterpolation &other)
virtual
nearestNeighborInterpolation
< T > * 
clone () const
virtual
nearestNeighborInterpolation
< T > * 
newInstance () const
const parametersgetParameters () const


Detailed Description

template<class T>
class cvr::nearestNeighborInterpolation< T >

This functor use nearestNeighbor 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

default constructor

template<class T>
cvr::nearestNeighborInterpolation< T >::nearestNeighborInterpolation ( const eBoundaryType  boundaryType  ) 

Construct an interpolator with the given boundary type.

copy constructor

Parameters:
other the object to be copied

template<class T>
virtual cvr::nearestNeighborInterpolation< T >::~nearestNeighborInterpolation (  )  [virtual]

destructor


Member Function Documentation

template<class T>
T cvr::nearestNeighborInterpolation< 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<class T>
T cvr::nearestNeighborInterpolation< 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<class T>
T cvr::nearestNeighborInterpolation< 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<class T>
T cvr::nearestNeighborInterpolation< 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<class T>
T cvr::nearestNeighborInterpolation< 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<class T>
T cvr::nearestNeighborInterpolation< 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<class T>
virtual nearestNeighborInterpolation<T>* cvr::nearestNeighborInterpolation< T >::clone (  )  const [virtual]

returns a pointer to a clone of this functor.

Implements cvr::functor.

template<class T>
nearestNeighborInterpolation& cvr::nearestNeighborInterpolation< T >::copy ( const nearestNeighborInterpolation< T > &  other  ) 

copy data of "other" functor.

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

template<class T>
const parameters& cvr::nearestNeighborInterpolation< T >::getParameters (  )  const

returns used parameters

Reimplemented from cvr::fixedGridInterpolation< T >.

template<class T>
int cvr::nearestNeighborInterpolation< 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<class T>
T cvr::nearestNeighborInterpolation< T >::interpolate ( 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 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<class T>
T cvr::nearestNeighborInterpolation< 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.

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<class T>
virtual const std::string& cvr::nearestNeighborInterpolation< T >::name (  )  const [virtual]

returns the name of this type ("nearestNeighborInterpolation")

Reimplemented from cvr::fixedGridInterpolation< T >.

template<class T>
virtual nearestNeighborInterpolation<T>* cvr::nearestNeighborInterpolation< T >::newInstance (  )  const [virtual]

returns a pointer to a clone of this functor.

Implements cvr::functor.


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

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