31 #ifndef DRAIN_SEGMENT_OP_H
32 #define DRAIN_SEGMENT_OP_H
38 #include "drain/util/FunctorBank.h"
39 #include "drain/image/SegmentProber.h"
63 std::string functorStr;
69 SegmentOp(
const std::string & name,
const std::string & description) :
101 if (functorStr.empty()){
103 return this->functor;
107 std::string functorName;
108 std::string functorParams;
110 if (unicloner.bank.
has(functorName)){
113 f.setScale(scale, bias);
116 mout.debug3(
" ftor: " , f );
121 mout.
fail(
"Functor '" , functorName ,
"' not found. Available functors:" );
123 mout.
note(
"Available functors:\n" , unicloner.bank );
126 mout.
warn(
"using default ftor: " , this->functor );
127 return this->functor;
bool has(const K &key) const
Check if a cloner is defined for this key.
Definition: Bank.h:141
void setParameters(std::initializer_list< Variable::init_pair_t > args)
Grants access to (if above hidden)
Definition: BeanLike.h:131
virtual const std::string & getName() const
Return the name of an instance.
Definition: BeanLike.h:69
LogSourc e is the means for a function or any program segment to "connect" to a Log.
Definition: Log.h:308
Logger & fail(const TT &... args)
Possible error, but execution can continue. Special type of Logger::warn().
Definition: Log.h:449
Logger & note(const TT &... args)
For top-level information.
Definition: Log.h:485
Logger & warn(const TT &... args)
Possible error, but execution can continue.
Definition: Log.h:426
Creates an entry of desired type and destroys it upon exit.
Definition: Bank.h:476
Base class for image processing functions.
Definition: ImageOp.h:49
ImageOp(const std::string &name=__FUNCTION__, const std::string &description="")
Definition: ImageOp.h:156
A base class for computing statistics of segments. As segment is an area of connected pixels.
Definition: SegmentOp.h:53
const UnaryFunctor & getFunctor(double scale=0.0, double bias=0.0) const
Retrieve functor to process the result: either the functor defined as functorStr or member functor (i...
Definition: SegmentOp.h:95
Definition: DataSelector.cpp:1277
FunctorBank & getFunctorBank()
Definition: FunctorBank.cpp:51
Definition: Functor.h:126
Definition: Functor.h:116