31 #ifndef SEGMENT_STATISTICS_OP_H
32 #define SEGMENT_STATISTICS_OP_H
34 #include "SegmentAreaOp.h"
86 SegmentStatisticsOp(
const std::string & statistics=
"d",
double min=1,
double max=255,
double scale=1.0,
double offset=0) :
87 SegmentOp(__FUNCTION__,
"Segment statistics: area, mx, my, variance, slimness, horizontality, verticality, elongation") {
88 parameters.link(
"statistics", this->statistics = statistics,
"aAxXyYsSlhve");
89 parameters.link(
"intensity", this->intensity.tuple(),
"min:max");
92 parameters.link(
"functor", this->functorStr);
93 this->intensity.set(min,max);
97 parameters.
copyStruct(op.getParameters(), op, *
this);
100 std::string statistics;
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
Struct for image (excluding data)
Definition: ImageConf.h:333
Container applicable for Channels and Images, with alpha support.
Definition: ImageTray.h:267
A base class for computing statistics of segments. As segment is an area of connected pixels.
Definition: SegmentOp.h:53
Computes statistics of segments: area, centroid, horizontality, verticality, variance and elongation....
Definition: SegmentStatisticsOp.h:79
virtual void traverseChannels(const ImageTray< const Channel > &src, ImageTray< Channel > &dst) const
Definition: SegmentStatisticsOp.cpp:97
SegmentStatisticsOp(const std::string &statistics="d", double min=1, double max=255, double scale=1.0, double offset=0)
Default constructor.
Definition: SegmentStatisticsOp.h:86
void getDstConf(const ImageConf &src, ImageConf &dst) const
Resizes dst, ensures src area and channel count for each stat. .
Definition: SegmentStatisticsOp.cpp:44
Definition: DataSelector.cpp:1277