latest version v1.9 - last update 10 Apr 2010 |
#include <ltiErosion.h>
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 |
erosion & | copy (const erosion &other) |
virtual functor * | clone () const |
const parameters & | getParameters () const |
void | setKernel (const mathObject &aKernel) |
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);
lti::erosion::erosion | ( | ) |
default constructor
lti::erosion::erosion | ( | const mathObject & | aKernel | ) |
construct with the given kernel
lti::erosion::erosion | ( | const erosion & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::erosion::~erosion | ( | ) | [virtual] |
destructor
bool lti::erosion::apply | ( | const vector< channel8::value_type > & | src, | |
vector< channel8::value_type > & | dest | |||
) | const |
operates on a copy of the given parameters.
src | vector<channel8::value_type> with the source data. | |
dest | vector<channel8::value_type> where the result will be left. |
operates on a copy of the given parameters.
src | fvector with the source data. | |
dest | fvector where the result will be left. |
Reimplemented from lti::modifier.
operates on a copy of the given parameters.
Implements lti::morphology.
operates on a copy of the given parameters.
Implements lti::morphology.
bool lti::erosion::apply | ( | vector< channel8::value_type > & | srcdest | ) | const |
operates on the given parameter.
srcdest | vector<channel8::value_type> with the source data. The result will be left here too. |
bool lti::erosion::apply | ( | fvector & | srcdest | ) | const |
operates on the given parameter.
srcdest | fvector with the source data. The result will be left here too. |
Reimplemented from lti::modifier.
bool lti::erosion::apply | ( | channel8 & | srcdest | ) | const [virtual] |
operates on the given parameter.
srcdest | channel8 with the source data. The result will be left here too. |
Implements lti::morphology.
bool lti::erosion::apply | ( | channel & | srcdest | ) | const [virtual] |
operates on the given parameter.
srcdest | channel with the source data. The result will be left here too. |
srcdest
. Implements lti::morphology.
virtual functor* lti::erosion::clone | ( | ) | const [virtual] |
returns a pointer to a clone of this functor.
Implements lti::functor.
copy data of "other" functor.
other | the functor to be copied |
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.