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

lti::erosion Class Reference
[Morphology operators]

Erosion functor. More...

#include <ltiErosion.h>

Inheritance diagram for lti::erosion:
Inheritance graph
[legend]
Collaboration diagram for lti::erosion:
Collaboration graph
[legend]

List of all members.

Classes

class  parameters
 the parameters for the class erosion More...

Public Member Functions

 erosion ()
 erosion (const mathObject &aKernel)
 erosion (const erosion &other)
virtual ~erosion ()
virtual const char * getTypeName () const
bool apply (channel &srcdest) const
bool apply (channel8 &srcdest) const
bool apply (fvector &srcdest) const
bool apply (vector< channel8::value_type > &srcdest) const
bool apply (const channel &src, channel &dest) const
bool apply (const channel8 &src, channel8 &dest) const
bool apply (const fvector &src, fvector &dest) const
bool apply (const vector< channel8::value_type > &src, vector< channel8::value_type > &dest) const
erosioncopy (const erosion &other)
virtual functorclone () const
const parametersgetParameters () const
void setKernel (const mathObject &aKernel)

Detailed Description

Erosion functor.

This functor implements the morphological operator "erosion". Through the parameters a "binary" or "gray scale" modus can be choosed, and the structuring element (represented by a linear filter kernel) can be given.

For mode Binary the destination image is set to 0 if there is a source element in the kernel region that is zero and to the norm value of the used kernel otherwise.

The definition for mode Gray can be found in e.g. Gonzalez, R. and Woods, R. Digital Image Processing, 2nd Edition, pp. 550--553, Prentice Hall, 2002

/code dest(s,t) = min(src(s-x, t-y) - kernel(x,y)) /endcode

where the regions of the kernel and source overlap. Qualitatively the Gray operation results in darkening esp. of bright details. For channel8 the resulting values are clipped to be in the allowed range of [0,255]. Note that for channels the kernel values should be much lower than the default 1.f. Also note that when the kernel is separable (sepKernel) the values of all column and row kernels are added. An example is chessBoardKernel.

Example:

 lti::erosion eroder;                   // the erosion functor
 lti::erosion::parameters erosionParam; // the parameters

 lti::cityBlockKernel<float> kern(3);   // 3x3 diamond shaped kernel

 // binary erosion
 erosionParam.mode = lti::erosion::parameters::Binary;
 erosionParam.setKernel(parameters);

 // set the parameters
 eroder.setParameters(erosionParam);

 // apply the erosion to a channel "chnlSrc" and leave the result in
 // "chnlDest"

 eroder.apply(chnlSrc,chnlDest);

Constructor & Destructor Documentation

lti::erosion::erosion (  ) 

default constructor

lti::erosion::erosion ( const mathObject aKernel  ) 

construct with the given kernel

lti::erosion::erosion ( const erosion other  ) 

copy constructor

Parameters:
other the object to be copied
virtual lti::erosion::~erosion (  )  [virtual]

destructor


Member Function Documentation

bool lti::erosion::apply ( const vector< channel8::value_type > &  src,
vector< channel8::value_type > &  dest 
) const

operates on a copy of the given parameters.

Parameters:
src vector<channel8::value_type> with the source data.
dest vector<channel8::value_type> where the result will be left.
Returns:
true if successful, false otherwise.
bool lti::erosion::apply ( const fvector src,
fvector dest 
) const [virtual]

operates on a copy of the given parameters.

Parameters:
src fvector with the source data.
dest fvector where the result will be left.
Returns:
true if successful, false otherwise.

Reimplemented from lti::modifier.

bool lti::erosion::apply ( const channel8 src,
channel8 dest 
) const [virtual]

operates on a copy of the given parameters.

Parameters:
src channel8 with the source data.
dest channel8 where the result will be left.
Returns:
true if successful, false otherwise.

Implements lti::morphology.

bool lti::erosion::apply ( const channel src,
channel dest 
) const [virtual]

operates on a copy of the given parameters.

Parameters:
src channel with the source data.
dest channel where the result will be left.
Returns:
true if successful, false otherwise.

Implements lti::morphology.

bool lti::erosion::apply ( vector< channel8::value_type > &  srcdest  )  const

operates on the given parameter.

Parameters:
srcdest vector<channel8::value_type> with the source data. The result will be left here too.
Returns:
true if successful, false otherwise.
bool lti::erosion::apply ( fvector srcdest  )  const

operates on the given parameter.

Parameters:
srcdest fvector with the source data. The result will be left here too.
Returns:
true if successful, false otherwise.

Reimplemented from lti::modifier.

bool lti::erosion::apply ( channel8 srcdest  )  const [virtual]

operates on the given parameter.

Parameters:
srcdest channel8 with the source data. The result will be left here too.
Returns:
true if successful, false otherwise.

Implements lti::morphology.

bool lti::erosion::apply ( channel srcdest  )  const [virtual]

operates on the given parameter.

Parameters:
srcdest channel with the source data. The result will be left here too.
Returns:
a reference to the srcdest.

Implements lti::morphology.

virtual functor* lti::erosion::clone (  )  const [virtual]

returns a pointer to a clone of this functor.

Implements lti::functor.

erosion& lti::erosion::copy ( const erosion other  ) 

copy data of "other" functor.

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

Reimplemented from lti::morphology.

const parameters& lti::erosion::getParameters (  )  const

returns used parameters

Reimplemented from lti::morphology.

virtual const char* lti::erosion::getTypeName (  )  const [virtual]

returns the name of this type ("erosion")

Reimplemented from lti::morphology.

void lti::erosion::setKernel ( const mathObject aKernel  ) 

shortcut to set the filter kernel in the functor parameters.

The other parameters remain unchanged.


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

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