latest version v1.9 - last update 10 Apr 2010 |
This functor maps a vector space of type Tin into another vector space of type Tout. More...
#include <ltiLinearSatMapperFunctor.h>
Classes | |
class | parameters |
the parameters for the class linearSatMapperFunctor More... | |
Public Member Functions | |
linearSatMapperFunctor () | |
linearSatMapperFunctor (const linearSatMapperFunctor &other) | |
virtual | ~linearSatMapperFunctor () |
virtual const char * | getTypeName () const |
virtual vector< Tout > & | apply (const vector< Tin > &src, vector< Tout > &dest) const |
point & | apply (const vector< Tin > &src, point &dest) const |
point & | apply (const Tin &src0, const Tin &src1, point &dest) const |
point & | apply (const point &src, point &dest) const |
Tout & | apply (const vector< Tin > &src, Tout &dest) const |
Tout & | apply (const Tin &src, Tout &dest) const |
linearSatMapperFunctor & | copy (const linearSatMapperFunctor &other) |
virtual functor * | clone () const |
const parameters & | getParameters () const |
virtual bool | updateParameters () |
Protected Attributes | |
fvector | slope |
fvector | b |
This functor maps a vector space of type Tin into another vector space of type Tout.
The dimensionality and boundaries of both spaces can be specified through the lti::mapperFunctor::parameters class.
The mapping-function is linear. If an input point is outer bounds, the output point will be corrected to the next valid dimension.
For the following example a chromaticity histogram will be created with 10 cells for the red and 16 cells for the green channel
lti::image img; // the image to be analysed // ... // load or create the image to be analysed lti::splitImageTorgI splitter; lti::channel r,g,I; splitter.apply(r,g,I); // get chromaticity channels lti::histogram2D histo(10,16); // a two dimensional histogram // the mapper functor lti::linearSatMapperFunctor<float> mapper; lti::linearSatMapperFunctor<float>::parameters mapParam; mapParam.generateFrom(histo); mapParam.lowerLimitsInput.fill(0.0f); mapParam.upperLimitsInput.fill(1.0f); histo.setParameters(mapParam); lti::point p,q; // for each pixel in the channels for (p.y=0;p.y<r.rows();p.y++) { for (p.x=0;p.x<g.rows();p.x++) { histo.put(mapper(r.at(p),g.at(p),q)); } }
lti::linearSatMapperFunctor< Tin, Tout >::linearSatMapperFunctor | ( | ) |
default constructor
lti::linearSatMapperFunctor< Tin, Tout >::linearSatMapperFunctor | ( | const linearSatMapperFunctor< Tin, Tout > & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::linearSatMapperFunctor< Tin, Tout >::~linearSatMapperFunctor | ( | ) | [virtual] |
destructor
Tout& lti::linearSatMapperFunctor< Tin, Tout >::apply | ( | const Tin & | src, | |
Tout & | dest | |||
) | const |
For the one dimensional case, maps a one dimensional vector in a output vector.
src | one-dimensional vector with the source data. | |
dest | one-dimensional vector where the result will be left. |
dest
. Reimplemented from lti::mapperFunctor< Tin, Tout >.
Tout& lti::linearSatMapperFunctor< Tin, Tout >::apply | ( | const vector< Tin > & | src, | |
Tout & | dest | |||
) | const |
For the one dimensional case, maps the input vector into a one dimensional vector of type Tout.
src | int with the source data. | |
dest | int where the result will be left. |
dest
. Reimplemented from lti::mapperFunctor< Tin, Tout >.
point& lti::linearSatMapperFunctor< Tin, Tout >::apply | ( | const point & | src, | |
point & | dest | |||
) | const |
For the two dimensional case, maps a two dimensional integer vector in another integer vector, both coded as points.
src | the source point. | |
dest | point where the result will be left. |
dest
. Reimplemented from lti::mapperFunctor< Tin, Tout >.
point& lti::linearSatMapperFunctor< Tin, Tout >::apply | ( | const Tin & | src0, | |
const Tin & | src1, | |||
point & | dest | |||
) | const |
For the two dimensional case, maps a two dimensional vector in a integer vector coded as a point.
src0 | the first element of the input vector | |
src1 | the second element of the input vector | |
dest | point where the result will be left. |
dest
. Reimplemented from lti::mapperFunctor< Tin, Tout >.
point& lti::linearSatMapperFunctor< Tin, Tout >::apply | ( | const vector< Tin > & | src, | |
point & | dest | |||
) | const |
For the two dimensional case, maps a two dimensional vector in a integer vector coded as a point.
src | ivector with the source data. | |
dest | point where the result will be left. |
dest
. Reimplemented from lti::mapperFunctor< Tin, Tout >.
virtual vector<Tout>& lti::linearSatMapperFunctor< Tin, Tout >::apply | ( | const vector< Tin > & | src, | |
vector< Tout > & | dest | |||
) | const [virtual] |
Map the input vector src in the output vector dest.
src | vector<Tin> with the source data. | |
dest | vector<Tout> where the result will be left. |
dest
. Reimplemented from lti::mapperFunctor< Tin, Tout >.
virtual functor* lti::linearSatMapperFunctor< Tin, Tout >::clone | ( | ) | const [virtual] |
returns a pointer to a clone of this functor.
Reimplemented from lti::mapperFunctor< Tin, Tout >.
linearSatMapperFunctor& lti::linearSatMapperFunctor< Tin, Tout >::copy | ( | const linearSatMapperFunctor< Tin, Tout > & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::mapperFunctor< Tin, Tout >.
const parameters& lti::linearSatMapperFunctor< Tin, Tout >::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::mapperFunctor< Tin, Tout >.
virtual const char* lti::linearSatMapperFunctor< Tin, Tout >::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("linearSatMapperFunctor")
Reimplemented from lti::mapperFunctor< Tin, Tout >.
virtual bool lti::linearSatMapperFunctor< Tin, Tout >::updateParameters | ( | ) | [virtual] |
set the parameters and check them for correctness
Reimplemented from lti::functor.
fvector lti::linearSatMapperFunctor< Tin, Tout >::b [protected] |
offset of the mapping lines.
These are calculated when setParameters is called
fvector lti::linearSatMapperFunctor< Tin, Tout >::slope [protected] |
slopes of the mapping lines.
These are calculated when setParameters is called