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

lti::maximumFilter< T > Class Template Reference

This is an efficient implementation of the non-linear maximum filter. More...

#include <ltiMaximumFilter.h>

Inheritance diagram for lti::maximumFilter< T >:
Inheritance graph
[legend]
Collaboration diagram for lti::maximumFilter< T >:
Collaboration graph
[legend]

List of all members.

Classes

class  parameters
 the parameters for the class maximumFilter More...

Public Member Functions

 maximumFilter ()
 maximumFilter (const parameters &par)
 maximumFilter (const int k)
 maximumFilter (const maximumFilter &other)
virtual ~maximumFilter ()
virtual const char * getTypeName () const
bool apply (matrix< T > &srcdest)
bool apply (vector< T > &srcdest)
bool apply (const matrix< T > &src, matrix< T > &dest)
bool apply (const vector< T > &src, vector< T > &dest)
maximumFiltercopy (const maximumFilter &other)
virtual functorclone () const
const parametersgetParameters () const
bool setKernelSize (const rectangle &ksize)
bool setSquareKernel (const int &ksize)
virtual bool updateParameters ()

Protected Member Functions

bool applyCol (const matrix< T > &src, matrix< T > &dest)
int getMirrorIndex (const int &x, const int &srcSize, bool &mirror) const
void insert (const int size, const T elem)
void insdel (const int size, const T insElem, const T delElem)

Protected Attributes

T * rawBuffer
T * buffer

Detailed Description

template<class T>
class lti::maximumFilter< T >

This is an efficient implementation of the non-linear maximum filter.

It assigns each pixel the maximal value in the region defined by the parameter kernelSize.

The template parameter T defines the type of the matrix or vector to be filtered.

An instance of this class cannot be used from different threads (not thread-save). If you have multiple threads, use simply one functor for each thread.

See also:
parameters

Constructor & Destructor Documentation

template<class T>
lti::maximumFilter< T >::maximumFilter (  ) 

default constructor

template<class T>
lti::maximumFilter< T >::maximumFilter ( const parameters par  ) 

constructor with a set of parameters

template<class T>
lti::maximumFilter< T >::maximumFilter ( const int  k  ) 

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

template<class T>
lti::maximumFilter< T >::maximumFilter ( const maximumFilter< T > &  other  ) 

copy constructor

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

destructor


Member Function Documentation

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

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.

Reimplemented in lti::localMaxima< T >, and lti::localMaxima< float >.

template<class T>
bool lti::maximumFilter< T >::apply ( const matrix< T > &  src,
matrix< T > &  dest 
)

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.

Reimplemented in lti::localMaxima< T >, and lti::localMaxima< float >.

template<class T>
bool lti::maximumFilter< T >::apply ( vector< T > &  srcdest  ) 

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.

Reimplemented in lti::localMaxima< T >, and lti::localMaxima< float >.

template<class T>
bool lti::maximumFilter< T >::apply ( matrix< T > &  srcdest  ) 

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.

Reimplemented in lti::localMaxima< T >, and lti::localMaxima< float >.

template<class T>
bool lti::maximumFilter< T >::applyCol ( const matrix< T > &  src,
matrix< T > &  dest 
) [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>
virtual functor* lti::maximumFilter< T >::clone (  )  const [virtual]

returns a pointer to a clone of this functor.

Implements lti::functor.

Reimplemented in lti::localMaxima< T >, and lti::localMaxima< float >.

template<class T>
maximumFilter& lti::maximumFilter< T >::copy ( const maximumFilter< T > &  other  ) 

copy data of "other" functor.

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

Reimplemented from lti::functor.

Reimplemented in lti::localMaxima< T >.

template<class T>
int lti::maximumFilter< T >::getMirrorIndex ( const int &  x,
const int &  srcSize,
bool &  mirror 
) const [inline, protected]

calculate the real index in an vector of size srcSize for a mirrored boundary

template<class T>
const parameters& lti::maximumFilter< T >::getParameters (  )  const

returns used parameters

Reimplemented from lti::modifier.

Reimplemented in lti::localMaxima< T >, and lti::localMaxima< float >.

template<class T>
virtual const char* lti::maximumFilter< T >::getTypeName (  )  const [virtual]

returns the name of this type ("maximumFilter")

Reimplemented from lti::modifier.

Reimplemented in lti::localMaxima< T >, and lti::localMaxima< float >.

template<class T>
void lti::maximumFilter< T >::insdel ( const int  size,
const T  insElem,
const T  delElem 
) [protected]

insert the element "elem" in the given buffer of size "size"

template<class T>
void lti::maximumFilter< T >::insert ( const int  size,
const T  elem 
) [protected]

insert the element "elem" in the buffer of size "size" pointed by the attribute buffer.

The last element of the buffer is supposed to be uninitialized.

template<class T>
bool lti::maximumFilter< T >::setKernelSize ( const rectangle ksize  ) 

shortcut to set the parameters with the given kernel size

template<class T>
bool lti::maximumFilter< T >::setSquareKernel ( const int &  ksize  ) 

shortcut to set the parameters with a square kernel (see also parameters::initSquare)

template<class T>
virtual bool lti::maximumFilter< T >::updateParameters (  )  [virtual]

set functor's parameters.

This member makes a copy of theParam: the functor will keep its own copy of the parameters!

Returns:
true if successful, false otherwise

Reimplemented from lti::functor.

Reimplemented in lti::localMaxima< T >, and lti::localMaxima< float >.


Member Data Documentation

template<class T>
T* lti::maximumFilter< T >::buffer [protected]

pointer to the buffer withing rawBuffer (there are elements after and before used to check boundary conditions

template<class T>
T* lti::maximumFilter< T >::rawBuffer [protected]

Sorted elements.

The memory is administrated by setParameters and the destructor.


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

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