latest version v1.9 - last update 10 Apr 2010 |
#include <ltiDilation.h>
Classes | |
class | parameters |
the parameters for the class dilation More... | |
Public Member Functions | |
dilation () | |
dilation (const mathObject &aKernel) | |
dilation (const dilation &other) | |
virtual | ~dilation () |
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 |
dilation & | copy (const dilation &other) |
virtual functor * | clone () const |
const parameters & | getParameters () const |
void | setKernel (const mathObject &aKernel) |
Dilation functor.
This functor implements the morphological operator "dilation". Through the parameters a "binary" or "gray scale" modus can be choosen, and the structuring element (represented by a linear filter kernel) can be given.
For mode Binary the destination image is set to the norm value of the kernel used if there is a source element in the kernel region that is not zero and to zero 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) = max(src(s-x, t-y) + kernel(x,y)) /endcode
where the regions of the kernel and source overlap. Qualitatively the Gray operation results in brightening esp. dark 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 subtracted. An example is chessBoardKernel.
Example:
lti::dilation dilator; // the dilation functor lti::dilation::parameters dilationParam; // the parameters lti::euclideanKernel<float> theKern(3); // a circular kernel // binary dilation dilationParam.mode = lti::dilation::parameters::Binary; dilationParam.setKernel(theKern); // set the parameters dilator.setParameters(dilationParam); // apply the dilation to a channel "chnlSrc" and leave the result in // "chnlDest" dilator.apply(chnlSrc,chnlDest);
lti::dilation::dilation | ( | ) |
default constructor
lti::dilation::dilation | ( | const mathObject & | aKernel | ) |
construct with the given kernel
lti::dilation::dilation | ( | const dilation & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::dilation::~dilation | ( | ) | [virtual] |
destructor
bool lti::dilation::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::dilation::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::dilation::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::dilation::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::dilation::apply | ( | channel & | srcdest | ) | const [virtual] |
operates on the given parameter.
srcdest | channel with the source data. The result will be left here too. |
Implements lti::morphology.
virtual functor* lti::dilation::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::dilation::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::morphology.
virtual const char* lti::dilation::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("dilation")
Reimplemented from lti::morphology.
void lti::dilation::setKernel | ( | const mathObject & | aKernel | ) |
shortcut to set the filter kernel in the functor parameters.
The other parameters remain unchanged.