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

lti::linearSatMapperFunctor< Tin, Tout > Class Template Reference

This functor maps a vector space of type Tin into another vector space of type Tout. More...

#include <ltiLinearSatMapperFunctor.h>

Inheritance diagram for lti::linearSatMapperFunctor< Tin, Tout >:
Inheritance graph
[legend]
Collaboration diagram for lti::linearSatMapperFunctor< Tin, Tout >:
Collaboration graph
[legend]

List of all members.

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
pointapply (const vector< Tin > &src, point &dest) const
pointapply (const Tin &src0, const Tin &src1, point &dest) const
pointapply (const point &src, point &dest) const
Tout & apply (const vector< Tin > &src, Tout &dest) const
Tout & apply (const Tin &src, Tout &dest) const
linearSatMapperFunctorcopy (const linearSatMapperFunctor &other)
virtual functorclone () const
const parametersgetParameters () const
virtual bool updateParameters ()

Protected Attributes

fvector slope
fvector b

Detailed Description

template<class Tin, class Tout = int>
class lti::linearSatMapperFunctor< Tin, Tout >

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));
     }
   }

Constructor & Destructor Documentation

template<class Tin, class Tout = int>
lti::linearSatMapperFunctor< Tin, Tout >::linearSatMapperFunctor (  ) 

default constructor

template<class Tin, class Tout = int>
lti::linearSatMapperFunctor< Tin, Tout >::linearSatMapperFunctor ( const linearSatMapperFunctor< Tin, Tout > &  other  ) 

copy constructor

Parameters:
other the object to be copied
template<class Tin, class Tout = int>
virtual lti::linearSatMapperFunctor< Tin, Tout >::~linearSatMapperFunctor (  )  [virtual]

destructor


Member Function Documentation

template<class Tin, class Tout = int>
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.

Parameters:
src one-dimensional vector with the source data.
dest one-dimensional vector where the result will be left.
Returns:
a reference to the dest.

Reimplemented from lti::mapperFunctor< Tin, Tout >.

template<class Tin, class Tout = int>
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.

Parameters:
src int with the source data.
dest int where the result will be left.
Returns:
a reference to the dest.

Reimplemented from lti::mapperFunctor< Tin, Tout >.

template<class Tin, class Tout = int>
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.

Parameters:
src the source point.
dest point where the result will be left.
Returns:
a reference to the dest.

Reimplemented from lti::mapperFunctor< Tin, Tout >.

template<class Tin, class Tout = int>
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.

Parameters:
src0 the first element of the input vector
src1 the second element of the input vector
dest point where the result will be left.
Returns:
a reference to the dest.

Reimplemented from lti::mapperFunctor< Tin, Tout >.

template<class Tin, class Tout = int>
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.

Parameters:
src ivector with the source data.
dest point where the result will be left.
Returns:
a reference to the dest.

Reimplemented from lti::mapperFunctor< Tin, Tout >.

template<class Tin, class Tout = int>
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.

Parameters:
src vector<Tin> with the source data.
dest vector<Tout> where the result will be left.
Returns:
a reference to the dest.

Reimplemented from lti::mapperFunctor< Tin, Tout >.

template<class Tin, class Tout = int>
virtual functor* lti::linearSatMapperFunctor< Tin, Tout >::clone (  )  const [virtual]

returns a pointer to a clone of this functor.

Reimplemented from lti::mapperFunctor< Tin, Tout >.

template<class Tin, class Tout = int>
linearSatMapperFunctor& lti::linearSatMapperFunctor< Tin, Tout >::copy ( const linearSatMapperFunctor< Tin, Tout > &  other  ) 

copy data of "other" functor.

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

Reimplemented from lti::mapperFunctor< Tin, Tout >.

template<class Tin, class Tout = int>
const parameters& lti::linearSatMapperFunctor< Tin, Tout >::getParameters (  )  const

returns used parameters

Reimplemented from lti::mapperFunctor< Tin, Tout >.

template<class Tin, class Tout = int>
virtual const char* lti::linearSatMapperFunctor< Tin, Tout >::getTypeName (  )  const [virtual]

returns the name of this type ("linearSatMapperFunctor")

Reimplemented from lti::mapperFunctor< Tin, Tout >.

template<class Tin, class Tout = int>
virtual bool lti::linearSatMapperFunctor< Tin, Tout >::updateParameters (  )  [virtual]

set the parameters and check them for correctness

Reimplemented from lti::functor.


Member Data Documentation

template<class Tin, class Tout = int>
fvector lti::linearSatMapperFunctor< Tin, Tout >::b [protected]

offset of the mapping lines.

These are calculated when setParameters is called

template<class Tin, class Tout = int>
fvector lti::linearSatMapperFunctor< Tin, Tout >::slope [protected]

slopes of the mapping lines.

These are calculated when setParameters is called


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

Generated on Sat Apr 10 15:28:29 2010 for LTI-Lib by Doxygen 1.6.1