latest version v1.9 - last update 10 Apr 2010 |
This is an efficient implementation of the non-linear maximum filter. More...
#include <ltiMaximumFilter.h>
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) |
maximumFilter & | copy (const maximumFilter &other) |
virtual functor * | clone () const |
const parameters & | getParameters () 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 |
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.
lti::maximumFilter< T >::maximumFilter | ( | ) |
default constructor
lti::maximumFilter< T >::maximumFilter | ( | const parameters & | par | ) |
constructor with a set of parameters
lti::maximumFilter< T >::maximumFilter | ( | const int | k | ) |
constructor to initialize the parameters with an square filter of k x k size.
lti::maximumFilter< T >::maximumFilter | ( | const maximumFilter< T > & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::maximumFilter< T >::~maximumFilter | ( | ) | [virtual] |
destructor
bool lti::maximumFilter< T >::apply | ( | const vector< T > & | src, | |
vector< T > & | dest | |||
) |
operates on a copy of the given parameters.
src | vector<T> with the source data. | |
dest | vector<T> where the result will be left. |
Reimplemented in lti::localMaxima< T >, and lti::localMaxima< float >.
bool lti::maximumFilter< T >::apply | ( | const matrix< T > & | src, | |
matrix< T > & | dest | |||
) |
operates on a copy of the given parameters.
src | matrix<T> with the source data. | |
dest | matrix<T> where the result will be left. |
Reimplemented in lti::localMaxima< T >, and lti::localMaxima< float >.
bool lti::maximumFilter< T >::apply | ( | vector< T > & | srcdest | ) |
operates on the given parameter.
srcdest | vector<T> with the source data. The result will be left here too. |
Reimplemented in lti::localMaxima< T >, and lti::localMaxima< float >.
bool lti::maximumFilter< T >::apply | ( | matrix< T > & | srcdest | ) |
operates on the given parameter.
srcdest | matrix<T> with the source data. The result will be left here too. |
Reimplemented in lti::localMaxima< T >, and lti::localMaxima< float >.
bool lti::maximumFilter< T >::applyCol | ( | const matrix< T > & | src, | |
matrix< T > & | dest | |||
) | [protected] |
applies the vertical part of the kernel to the matrix
src | matrix<T> with the source data. | |
dest | matrix<T> where the result will be left. |
dest
. 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 >.
maximumFilter& lti::maximumFilter< T >::copy | ( | const maximumFilter< T > & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::functor.
Reimplemented in lti::localMaxima< 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
const parameters& lti::maximumFilter< T >::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::modifier.
Reimplemented in lti::localMaxima< T >, and lti::localMaxima< float >.
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 >.
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"
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.
bool lti::maximumFilter< T >::setKernelSize | ( | const rectangle & | ksize | ) |
shortcut to set the parameters with the given kernel size
bool lti::maximumFilter< T >::setSquareKernel | ( | const int & | ksize | ) |
shortcut to set the parameters with a square kernel (see also parameters::initSquare)
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!
Reimplemented from lti::functor.
Reimplemented in lti::localMaxima< T >, and lti::localMaxima< float >.
T* lti::maximumFilter< T >::buffer [protected] |
pointer to the buffer withing rawBuffer (there are elements after and before used to check boundary conditions
T* lti::maximumFilter< T >::rawBuffer [protected] |
Sorted elements.
The memory is administrated by setParameters and the destructor.