34 #include <drain/TypeUtils.h>
40 #include "SlidingWindowOp.h"
74 std::vector<double> sum;
88 drain::Logger mout(getImgLog(),
"FlowAverageWindow", __FUNCTION__);
90 mout.
debug2(
"srcTray:\n" , srcTray );
91 mout.
debug2(
"dstTray:\n" , dstTray );
93 if (srcWeight.isEmpty())
94 mout.
debug(
"no src alpha" );
96 if (dstWeight.isEmpty())
97 mout.
debug(
"no dst alpha" );
99 if (!srcTray.checkGeometry()){
100 mout.
special(
"scrTray geom: " , srcTray.getGeometry() );
101 mout.
special(
"content geom: " , srcTray );
102 mout.
error(
"srcTray geometry inconsistent" );
105 if (!dstTray.checkGeometry()){
106 mout.
special(
"dstTray geom: " , dstTray.getGeometry() );
107 mout.
special(
"content geom: " , dstTray );
108 mout.
error(
"dstTray geometry inconsistent" );
115 limiter = this->dst.getConf().getLimiter<
double>();
117 sum.resize(dstTray.size(), 0.0);
123 std::fill(sum.begin(), sum.end(), 0);
130 this->coordinateHandler.set(this->src.getGeometry(), this->src.getCoordinatePolicy());
181 this->traverseMultiChannel(src, dst);
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 & special(const TT &... args)
Other useful information.
Definition: Log.h:527
Logger & debug(const TT &... args)
Public, yet typically used "internally", when TIMING=true.
Definition: Log.h:676
Logger & debug2(const TT &... args)
Debug information.
Definition: Log.h:686
Window average that preserves the magnitude.
Definition: FlowAverageWindowOp.h:171
Definition: FlowAverageWindowOp.h:145
virtual void addPixel(Point2D< int > &p)
Adds a pixel to window statistics. Unvalidated location.
Definition: FlowAverageWindowOp.cpp:147
virtual void removePixel(Point2D< int > &p)
Removes a pixel from window statistics. Unvalidated location.
Definition: FlowAverageWindowOp.cpp:121
virtual void write()
Write the result in the target image.
Definition: FlowAverageWindowOp.cpp:174
Window average that preserves the magnitude.
Definition: FlowAverageWindowOp.h:53
void initialize()
Sets class-specific initial values. Does not change general window state (e.g. location)....
Definition: FlowAverageWindowOp.h:86
virtual void addPixel(Point2D< int > &p)
Adds a pixel to window statistics. Unvalidated location.
Definition: FlowAverageWindowOp.cpp:70
void setImageLimits() const
Sets internal limits corresponding to image geometries. Typically using coordHandler.
Definition: FlowAverageWindowOp.h:129
virtual void removePixel(Point2D< int > &p)
Removes a pixel from window statistics. Unvalidated location.
Definition: FlowAverageWindowOp.cpp:49
virtual void write()
Write the result in the target image.
Definition: FlowAverageWindowOp.cpp:89
void clear()
Clears statistics.
Definition: FlowAverageWindowOp.h:122
Container applicable for Channels and Images, with alpha support.
Definition: ImageTray.h:267
Template for operators applying pipeline-like sliding window.
Definition: SlidingWindowOp.h:59
Window implementation that uses incremental update of state.
Definition: SlidingWindow.h:50
virtual void fillBoth()
Clears and computes the statistics for the current location.
Definition: SlidingWindow.h:396
Base class for configurations applied in image processing windows, e.g. for operators of type WindowO...
Definition: Window.h:56
Point2D< int > location
Current location of this window.
Definition: Window.h:520
void setLoopLimits()
Sets the actual traversal range inside the window. Sometimes applied dynamically by reset().
Definition: Window.h:608
Class for ensuring that variable of type D remains within limits of type S.
Definition: TypeUtils.h:653
Definition: DataSelector.cpp:1277