31 #ifndef GaussianWindow_H_
32 #define GaussianWindow_H_
58 template <
bool DIR=true,
class R=WindowCore>
63 typedef float value_t;
66 this->conf.radius = radius;
76 this->coordinateHandler.set(this->src.getConf());
83 drain::Logger mout(getImgLog(),
"GaussianStripe", __FUNCTION__);
90 const int n = std::max(this->conf.frame.width, this->conf.frame.height);
91 const int bias = std::min(this->
iRange.min, this->jRange.min);
95 const double radiusAbs = this->conf.radius *
static_cast<value_t
>(n)*0.5;
96 const double radiusAbs2 = radiusAbs*radiusAbs;
97 if (radiusAbs <= 0.0){
98 mout.
error(
"Zero radius2: " , radiusAbs );
102 mout.
debug(
"frame:" , this->conf.frame );
103 for (
int i = 0; i < n; ++i) {
105 f = exp2(-
static_cast<double>(iNorm*iNorm) / radiusAbs2);
108 mout.
debug(i ,
'\t' , iNorm ,
'\t' , f ,
'\t' , weightSum );
110 mout.
debug(
"weightSum = " , weightSum );
112 scaleResult = this->src.getScaling().
getScale() / this->dst.getScaling().
getScale();
113 mout.
debug(
"scale = " , scaleResult );
122 void setSize(
size_t width = 1){
130 drain::Logger mout(getImgLog(),
"SlidingStripe", __FUNCTION__);
132 mout.
warn(
"horz stripe, height(" , height ,
") discarded" );
139 std::vector<value_t> lookUp;
178 template <
bool DIR=true>
192 this->dstWeight.put(this->
location, this->weightSum);
LogSourc e is the means for a function or any program segment to "connect" to a Log.
Definition: Log.h:308
Logger & error(const TT &... args)
Echoes.
Definition: Log.h:412
Logger & warn(const TT &... args)
Possible error, but execution can continue.
Definition: Log.h:426
Logger & debug(const TT &... args)
Public, yet typically used "internally", when TIMING=true.
Definition: Log.h:676
double getScale() const
Returns the intensity scaling factor. See set setScale()
Definition: ValueScaling.h:252
Definition: GaussianWindow.h:179
virtual void write()
At each location, the result of computation to dst image(s).
Definition: GaussianWindow.h:190
Definition: GaussianWindow.h:59
virtual void setImageLimits() const
Sets internal limits corresponding to image geometries. Typically using coordHandler.
Definition: GaussianWindow.h:75
virtual void write()
At each location, the result of computation to dst image(s).
Definition: GaussianWindow.h:143
void initialize()
Definition: GaussianWindow.h:81
virtual void setSize(size_t width, size_t height)
Sets the window size.
Definition: GaussianWindow.h:129
value_t sumW
Current weighted sum.
Definition: GaussianWindow.h:168
virtual void update()
At each location, this is called to calculate and store something in members.
value_t w
Current weight.
Definition: GaussianWindow.h:166
Extends WindowConfig with radius.
Definition: GaussianWindow.h:45
void put(size_t i, T x)
Sets the intensity in location i to x. See \address.
Definition: ImageFrame.h:192
Base class for configurations applied in image processing windows, e.g. for operators of type WindowO...
Definition: Window.h:56
Base class for windows applied by WindowOp's.
Definition: Window.h:404
Point2D< int > location
Current location of this window.
Definition: Window.h:520
virtual void setSize(size_t width, size_t height)
Sets the window size.
Definition: Window.h:479
void setLoopLimits()
Sets the actual traversal range inside the window. Sometimes applied dynamically by reset().
Definition: Window.h:608
Range< int > iRange
Studies source and destination images and decides whether scaling (SCALE=true) should be set.
Definition: Window.h:572
Definition: DataSelector.cpp:1277