LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::squareConvolution< T, A > Class Template Reference

This is an efficient implementation of the convolution with a square or rectangular kernel. More...

#include <ltiSquareConvolution.h>

Inheritance diagram for lti::squareConvolution< T, A >:
Inheritance graph
[legend]
Collaboration diagram for lti::squareConvolution< T, A >:
Collaboration graph
[legend]

List of all members.

Classes

class  parameters
 the parameters for the class squareConvolution More...

Public Member Functions

 squareConvolution ()
 squareConvolution (const int k)
 squareConvolution (const squareConvolution &other)
virtual ~squareConvolution ()
virtual const char * getTypeName () const
bool apply (matrix< T > &srcdest) const
bool apply (vector< T > &srcdest) const
bool apply (const matrix< T > &src, matrix< T > &dest) const
bool apply (const vector< T > &src, vector< T > &dest) const
squareConvolutioncopy (const squareConvolution &other)
virtual functorclone () const
const parametersgetParameters () const

Protected Member Functions

matrix< T > & applyCol (const matrix< T > &src, matrix< T > &dest) const

Detailed Description

template<class T, class A = T>
class lti::squareConvolution< T, A >

This is an efficient implementation of the convolution with a square or rectangular kernel.

The template parameter T defines the type of the matrix or vector to be filtered, and A represents the accumulator class, which allows different modi for the convolution.

The class A must implement following members:

This way, you can use any simple-types (as int, char, double...) as accumulator for a linear filter, or a user-defined class for a region normalization with any norm! For an example of an accumulator class see lti::chrominanzHistogram::l2accumulator<T>.

Note that for convolving a rectangular filter kernel with a channel8, you shoud use an instance squareConvolution<ubyte,int>. If you forget the "int" parameter, some quite noisy overflowing effects should be expected!

See also:
parameters

Constructor & Destructor Documentation

template<class T , class A = T>
lti::squareConvolution< T, A >::squareConvolution (  ) 

default constructor

template<class T , class A = T>
lti::squareConvolution< T, A >::squareConvolution ( const int  k  ) 

constructor to initialize the parameters with an square filter of k x k size.

template<class T , class A = T>
lti::squareConvolution< T, A >::squareConvolution ( const squareConvolution< T, A > &  other  ) 

copy constructor

Parameters:
other the object to be copied
template<class T , class A = T>
virtual lti::squareConvolution< T, A >::~squareConvolution (  )  [virtual]

destructor


Member Function Documentation

template<class T , class A = T>
bool lti::squareConvolution< T, A >::apply ( const vector< T > &  src,
vector< T > &  dest 
) const

operates on a copy of the given parameters.

Parameters:
src vector<T> with the source data.
dest vector<T> where the result will be left.
Returns:
true if successful, false otherwise.
template<class T , class A = T>
bool lti::squareConvolution< T, A >::apply ( const matrix< T > &  src,
matrix< T > &  dest 
) const

operates on a copy of the given parameters.

Parameters:
src matrix<T> with the source data.
dest matrix<T> where the result will be left.
Returns:
true if successful, false otherwise.
template<class T , class A = T>
bool lti::squareConvolution< T, A >::apply ( vector< T > &  srcdest  )  const

operates on the given parameter.

Parameters:
srcdest vector<T> with the source data. The result will be left here too.
Returns:
true if successful, false otherwise.
template<class T , class A = T>
bool lti::squareConvolution< T, A >::apply ( matrix< T > &  srcdest  )  const

operates on the given parameter.

Parameters:
srcdest matrix<T> with the source data. The result will be left here too.
Returns:
true if successful, false otherwise.
template<class T , class A = T>
matrix<T>& lti::squareConvolution< T, A >::applyCol ( const matrix< T > &  src,
matrix< T > &  dest 
) const [protected]

applies the vertical part of the kernel to the matrix

Parameters:
src matrix<T> with the source data.
dest matrix<T> where the result will be left.
Returns:
a reference to the dest.
template<class T , class A = T>
virtual functor* lti::squareConvolution< T, A >::clone (  )  const [virtual]

returns a pointer to a clone of this functor.

Implements lti::functor.

template<class T , class A = T>
squareConvolution& lti::squareConvolution< T, A >::copy ( const squareConvolution< T, A > &  other  ) 

copy data of "other" functor.

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

Reimplemented from lti::functor.

template<class T , class A = T>
const parameters& lti::squareConvolution< T, A >::getParameters (  )  const

returns used parameters

Reimplemented from lti::modifier.

template<class T , class A = T>
virtual const char* lti::squareConvolution< T, A >::getTypeName (  )  const [virtual]

returns the name of this type ("squareConvolution")

Reimplemented from lti::modifier.


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

Generated on Sat Apr 10 15:27:54 2010 for LTI-Lib by Doxygen 1.6.1