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

lti::localMaxima< T > Class Template Reference

This simple functor tries to find the local maxima at a given window and suppresses all other values, setting them the "nonMaxValue" given in the parameters (usually 0). More...

#include <ltiLocalMaxima.h>

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

List of all members.

Classes

class  parameters
 the parameters for the class localMaxima More...

Public Member Functions

 localMaxima ()
 localMaxima (const parameters &par)
 localMaxima (const localMaxima &other)
virtual ~localMaxima ()
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 matrix< T > &src, matrix< T > &dest, pointList &theMaxs)
bool apply (const matrix< T > &src, pointList &theMaxs)
bool apply (const vector< T > &src, vector< T > &dest)
localMaximacopy (const localMaxima &other)
localMaximaoperator= (const localMaxima &other)
virtual functorclone () const
const parametersgetParameters () const
virtual bool updateParameters ()

Protected Member Functions

bool apply (const vector< T > &src, const vector< T > &maxRes, vector< T > &dest)
getValue (const T srcVal) const
bool hystheresisSuppression (const matrix< T > &src, matrix< T > &localMax, pointList &maxList) const

Protected Attributes

suppressValue

Static Protected Attributes

static const T minimumT

Detailed Description

template<class T>
class lti::localMaxima< T >

This simple functor tries to find the local maxima at a given window and suppresses all other values, setting them the "nonMaxValue" given in the parameters (usually 0).

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 instance for each thread.

This class is used for example in the extraction of the maxima in the Hough Transform.

A very similar functor with more use in edge-detection applications is the lti::nonMaximaSuppression, which is used for example in the Canny edge detection.

See also:
parameters
lti::nonMaximaSuppression

Constructor & Destructor Documentation

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

default constructor

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

Construct a functor using the given parameters.

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

copy constructor

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

destructor


Member Function Documentation

template<class T>
bool lti::localMaxima< T >::apply ( const vector< T > &  src,
const vector< T > &  maxRes,
vector< T > &  dest 
) [protected]

operates on a copy of the given parameters.

Parameters:
src vector<T> with the source data.
maxRes vector<T> with the source data, where is has been filtered to contain the max of columns.
dest vector<T> where the result will be left.
Returns:
true if apply successful or false otherwise.
template<class T>
bool lti::localMaxima< T >::apply ( const vector< T > &  src,
vector< T > &  dest 
)

Extract the local maxima from src and leave the result in dest, consisting on the maxima values in their respective positions and in the rest of the image the value indicated in parameters::noMaxValue.

Parameters:
src vector<T> with the source data.
dest vector<T> where the result will be left.
Returns:
true if apply successful or false otherwise.

Reimplemented from lti::maximumFilter< T >.

template<class T>
bool lti::localMaxima< T >::apply ( const matrix< T > &  src,
pointList theMaxs 
)

Extract the local maxima from src and leave their position in the given theMaxs point-list.

Parameters:
src matrix<T> with the source data.
theMaxs list of points where the local maxima are found. It is sorted in decreasing order of the maxima values
Returns:
true if apply successful or false otherwise.
template<class T>
bool lti::localMaxima< T >::apply ( const matrix< T > &  src,
matrix< T > &  dest,
pointList theMaxs 
)

Extract the local maxima from src and leave the result in dest, consisting on the maxima values in their respective positions and in the rest of the image the value indicated in parameters::noMaxValue.

Those positions with local maxima are also stored in the theMaxs list.

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.
theMaxs list of points where the local maxima are found. It is sorted in decreasing order of the maxima values
Returns:
true if apply successful or false otherwise.
template<class T>
bool lti::localMaxima< T >::apply ( const matrix< T > &  src,
matrix< T > &  dest 
)

Extract the local maxima from src and leave the result in dest, consisting on the maxima values in their respective positions and in the rest of the image the value indicated in parameters::noMaxValue.

Parameters:
src matrix<T> with the source data.
dest matrix<T> where the result will be left.
Returns:
true if apply successful or false otherwise.

Reimplemented from lti::maximumFilter< T >.

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

Extract the local maxima from srcdest and leave the result there too, consisting on the maxima values in their respective positions and in the rest of the image the value indicated in parameters::noMaxValue.

Parameters:
srcdest vector<T> with the source data. The result will be left here too.
Returns:
true if apply successful or false otherwise.

Reimplemented from lti::maximumFilter< T >.

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

Extract the local maxima from srcdest and leave the result there too, consisting on the maxima values in their respective positions and in the rest of the image the value indicated in parameters::noMaxValue.

Parameters:
srcdest matrix<T> with the source data. The result will be left here too.
Returns:
true if apply successful or false otherwise.

Reimplemented from lti::maximumFilter< T >.

template<class T>
virtual functor* lti::localMaxima< T >::clone (  )  const [virtual]

returns a pointer to a clone of this functor.

Reimplemented from lti::maximumFilter< T >.

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

copy data of "other" functor.

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

Reimplemented from lti::maximumFilter< T >.

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

returns used parameters

Reimplemented from lti::maximumFilter< T >.

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

returns the name of this type ("localMaxima")

Reimplemented from lti::maximumFilter< T >.

template<class T>
T lti::localMaxima< T >::getValue ( const T  srcVal  )  const [inline, protected]

this function evaluates if the given srcVal can be a local maximum depending on the content of the buffer array (in the parent class).

template<class T>
bool lti::localMaxima< T >::hystheresisSuppression ( const matrix< T > &  src,
matrix< T > &  localMax,
pointList maxList 
) const [protected]

Suppression with hystheresis.

Given all local maxima in localMax, this method sorts them and beginning with the smallest ones, it starts a region search through all pixels with a value greater than the local maximum being evaluated multiplied with the parameter hystheresisThreshold. All other local maxima found in the region will be absorved if they are smaller, or they eliminate the actual local maximum if they are greater.

Parameters:
src the source image
localMax local maxima found. It may contain at the end of the algorithm less maxima as in the beginning. Also the minimumT value will be replaced by suppressValue.
maxList list of local maxima sorted in descending order.
template<class T>
localMaxima& lti::localMaxima< T >::operator= ( const localMaxima< T > &  other  ) 

alias for copy member

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

Reimplemented from lti::functor.

template<class T>
virtual bool lti::localMaxima< 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::maximumFilter< T >.


Member Data Documentation

template<class T>
const T lti::localMaxima< T >::minimumT [static, protected]

minimumT is the smallest number that type T can describe

template<class T>
T lti::localMaxima< T >::suppressValue [protected]

value used to indicate a "suppressed" value (usually 0)


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

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