31 #ifndef ACCUMULATION_H_
32 #define ACCUMULATION_H_
39 #include <drain/util/Bank.h>
40 #include <drain/util/BeanLike.h>
41 #include <drain/util/Point.h>
42 #include <drain/util/Rectangle.h>
44 #include "CoordinatePolicy.h"
45 #include "AccumulationArray.h"
92 throw std::runtime_error(
"AccumulationMethod::add - method/rule UNDEFINED");
98 void add(
AccumulationArray & accArray,
const size_t i,
double value,
double weight,
unsigned int count)
const {
99 add(accArray, i, value, weight);
144 void extractDev(
const AccumulationArray & accArray,
const AccumulationConverter & coder, Image & dst,
const drain::Rectangle<int> & crop = {0,0,0,0})
const;
173 AccumulationMethod(
const std::string & name) : BeanLike(name, __FUNCTION__) {
246 void add(
AccumulationArray & accArray,
const size_t i,
double value,
double weight,
unsigned int count)
const;
268 parameters.link(
"p",
p = 1.0);
269 parameters.link(
"r",
r = 1.0);
270 parameters.link(
"bias", bias = 0.0);
276 parameters.
copyStruct(method.parameters, method, *
this);
293 void add(
AccumulationArray & accArray,
const size_t i,
double value,
double weight,
unsigned int count)
const;
319 mutable double pInv = 1.0;
320 mutable bool USE_P =
false;
324 mutable double rInv = 1.0;
325 mutable bool USE_R =
false;
Something which has a name, a description and possibly some parameters of varying type.
Definition: BeanLike.h:60
virtual const std::string & getName() const
Return the name of an instance.
Definition: BeanLike.h:69
virtual const std::string & getDescription() const
Return a brief description.
Definition: BeanLike.h:74
void copyStruct(const ReferenceMap &m, const T &src, T &dst, extLinkPolicy policy=RESERVE)
Experimental. Copies references and values of a structure to another.
Definition: ReferenceMap.h:399
General-purpose image compositing.
Definition: AccumulationArray.h:112
Function for accumulating data: maximum, average, weighted average etc.
Definition: AccumulationMethods.h:64
virtual void add(AccumulationArray &accArray, const size_t i, double value, double weight, unsigned int count) const
Adds 'count' copies of a weighted value to the accumulation array.
Definition: AccumulationMethods.h:98
void initDstOLD(const AccumulationArray &accArray, const AccumulationConverter &coder, Image &dst, const drain::Rectangle< int > &crop) const
Sets variables that depend on public parameters. Called by setParameters().
Definition: AccumulationMethods.cpp:75
virtual void extractWeight(const AccumulationArray &accArray, const AccumulationConverter &coder, Image &dst, const drain::Rectangle< int > &crop={0, 0, 0, 0}) const
Retrieves the (average) weight of the accumulated values.
Definition: AccumulationMethods.cpp:186
virtual void extractValue(const AccumulationArray &accArray, const AccumulationConverter &coder, Image &dst, const drain::Rectangle< int > &crop={0, 0, 0, 0}) const
Retrieve the accumulated values from the accumulation matrix back to a data array.
Definition: AccumulationMethods.cpp:106
virtual void extractDev(const AccumulationArray &accArray, const AccumulationConverter &coder, Image &dst, const drain::Rectangle< int > &crop={0, 0, 0, 0}) const
Retrieves the standard deviation of the accumulated values.
Definition: AccumulationMethods.cpp:258
virtual void extractCount(const AccumulationArray &accArray, const AccumulationConverter &coder, Image &dst, const drain::Rectangle< int > &crop={0, 0, 0, 0}) const
Retrieves the count of values accumulated.
Definition: AccumulationMethods.cpp:229
virtual void add(AccumulationArray &accArray, const size_t i, double value, double weight) const
Adds a weighted value to the accumulation array.
Definition: AccumulationMethods.h:91
Definition: AccumulationMethods.h:234
virtual void extractWeight(const AccumulationArray &accArray, const AccumulationConverter &coder, Image &dst, const drain::Rectangle< int > &crop={0, 0, 0, 0}) const
Retrieves the (average) weight of the accumulated values.
Definition: AccumulationMethods.cpp:484
virtual void add(AccumulationArray &accArray, const size_t i, double value, double weight) const
Adds a weighted value to the accumulation array.
Definition: AccumulationMethods.cpp:388
virtual void extractValue(const AccumulationArray &accArray, const AccumulationConverter &coder, Image &dst, const drain::Rectangle< int > &crop={0, 0, 0, 0}) const
Retrieve the accumulated values from the accumulation matrix back to a data array.
Definition: AccumulationMethods.cpp:413
virtual void extractDev(const AccumulationArray &accArray, const AccumulationConverter &coder, Image &dst, const drain::Rectangle< int > &crop={0, 0, 0, 0}) const
Retrieves the standard deviation of the accumulated values.
Definition: AccumulationMethods.cpp:535
Class for multi-channel digital images. Supports dynamic typing with base types (char,...
Definition: Image.h:184
Definition: AccumulationMethods.h:207
virtual void add(AccumulationArray &accArray, const size_t i, double value, double weight) const
Adds a weighted value to the accumulation array.
Definition: AccumulationMethods.cpp:360
Definition: AccumulationMethods.h:330
virtual void add(AccumulationArray &accArray, const size_t i, double value, double weight) const
Adds a weighted value to the accumulation array.
Definition: AccumulationMethods.cpp:906
Definition: AccumulationMethods.h:220
virtual void add(AccumulationArray &accArray, const size_t i, double value, double weight) const
Adds a weighted value to the accumulation array.
Definition: AccumulationMethods.cpp:374
Definition: AccumulationMethods.h:190
virtual void add(AccumulationArray &accArray, const size_t i, double value, double weight) const
Adds a weighted value to the accumulation array.
Definition: AccumulationMethods.cpp:291
virtual void extractDev(const AccumulationArray &accArray, const AccumulationConverter &coder, Image &dst, const drain::Rectangle< int > &crop={0, 0, 0, 0}) const
Special defimition: difference.
Definition: AccumulationMethods.cpp:306
Definition: AccumulationMethods.h:261
virtual void extractWeight(const AccumulationArray &accArray, const AccumulationConverter &coder, Image &dst, const drain::Rectangle< int > &crop={0, 0, 0, 0}) const
Retrieves the (average) weight of the accumulated values.
Definition: AccumulationMethods.cpp:771
virtual void updateBean() const
Called after setParameters()
Definition: AccumulationMethods.cpp:585
double r
Power for weights.
Definition: AccumulationMethods.h:323
virtual void add(AccumulationArray &accArray, const size_t i, double value, double weight) const
Adds a weighted value to the accumulation array.
Definition: AccumulationMethods.cpp:605
virtual void extractValue(const AccumulationArray &accArray, const AccumulationConverter &coder, Image &dst, const drain::Rectangle< int > &crop={0, 0, 0, 0}) const
Retrieve the accumulated values from the accumulation matrix back to a data array.
Definition: AccumulationMethods.cpp:672
virtual void extractDev(const AccumulationArray &accArray, const AccumulationConverter &coder, Image &dst, const drain::Rectangle< int > &crop={0, 0, 0, 0}) const
Retrieves the standard deviation of the accumulated values.
Definition: AccumulationMethods.cpp:829
double p
Power for data values.
Definition: AccumulationMethods.h:318
Definition: DataSelector.cpp:1277
Rectange defined through lower left and upper right coordinates.
Definition: Rectangle.h:65
Converts raw data to values appropriate for accumulation.
Definition: AccumulationConverter.h:50