Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Accumulator Class Reference

#include <Accumulator.h>

Inheritance diagram for Accumulator:
Inheritance graph
[legend]
Collaboration diagram for Accumulator:
Collaboration graph
[legend]

Public Member Functions

 Accumulator ()
 
 Accumulator (const Accumulator &acc)
 
void setMethod (const std::string &method)
 Set method to some of the predefined methods.
 
void setMethod (const std::string &name, const std::string &params)
 Set method to some of the predefined methods.
 
void setMethod (const AccumulationMethod &method)
 Copies the method and its parameters. More...
 
bool isMethodSet () const
 
const AccumulationMethodgetMethod () const
 
AccumulationMethodgetMethod ()
 
void add (const size_t i, double value, double weight)
 Adds decoded data that applies natural scaling.
 
void add (const size_t i, double value, double weight, unsigned int count)
 Adds decoded data that applies natural scaling.
 
void addData (const Image &src, const AccumulationConverter &converter, double weight=1.0, int iOffset=0, int jOffset=0)
 Add (accumulate) data with given prior weight. More...
 
void addData (const Image &src, const Image &srcQuality, const AccumulationConverter &converter, double weight=1.0, int iOffset=0, int jOffset=0)
 Add (accumulate) data weighted with input quality. More...
 
void addData (const Image &src, const Image &srcQuality, const Image &srcCount, const AccumulationConverter &converter)
 Add (accumulate) data weighted with input quality and count; each data(i,j) contributes count(i,j) times. More...
 
void extractField (char field, const AccumulationConverter &converter, Image &dst, const drain::Rectangle< int > &crop) const
 Extracts the accumulated quantity or secondary quantities like weight and standard deviation. More...
 
virtual std::ostream & toStream (std::ostream &ostr) const
 

Public Attributes

AccumulationArray accArray
 Todo: export.
 

Protected Member Functions

void initDst (const AccumulationConverter &coder, Image &dst, drain::Rectangle< int > &cropArea) const
 

Protected Attributes

AccumulationMethod undefinedMethod
 A Some predefined methods, that can be set with setMethod(const std::string & key).
 
AccumulationMethodmethodPtr
 

Detailed Description

Accumulator contains five built-in accumulation methods (principles):

  1. overwrite
  2. maximum
  3. average
  4. weighted average
  5. maximum weight The methods can be extended user defined methods with addMethod() .

Constructor & Destructor Documentation

◆ Accumulator()

Accumulator ( )
inline

TODO: a static map?

Member Function Documentation

◆ addData() [1/3]

void addData ( const Image src,
const AccumulationConverter converter,
double  weight = 1.0,
int  iOffset = 0,
int  jOffset = 0 
)

Add (accumulate) data with given prior weight.

Parameters
src- input data

◆ addData() [2/3]

void addData ( const Image src,
const Image srcQuality,
const AccumulationConverter converter,
double  weight = 1.0,
int  iOffset = 0,
int  jOffset = 0 
)

Add (accumulate) data weighted with input quality.

Parameters
src- input data
srcQuality- quality field of input data

◆ addData() [3/3]

void addData ( const Image src,
const Image srcQuality,
const Image srcCount,
const AccumulationConverter converter 
)

Add (accumulate) data weighted with input quality and count; each data(i,j) contributes count(i,j) times.

Parameters
src- input data
srcQuality- quality field of input data
srcCount- counts of input data (makes difference in resulting weights)

Count is bypassed when necessary; for example, when the accumulation method is MAXIMUM.

◆ extractField()

void extractField ( char  field,
const AccumulationConverter converter,
Image dst,
const drain::Rectangle< int > &  crop 
) const

Extracts the accumulated quantity or secondary quantities like weight and standard deviation.

Parameters
field- data layer to be extracted
  • d = data;
  • w = weight (8bit uchar); W = with same storage type as data
  • c = count (8bit uchar);
  • s = standard deviation, unscaled

◆ setMethod()

void setMethod ( const AccumulationMethod method)
inline

Copies the method and its parameters.

That is, does not copy the target (accumulator &). This limits to those already registered in AccMethodBank.


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