34#include <drain/TypeUtils.h>
40#include "drain/image/SlidingWindow.h"
41#include "SlidingWindowOp.h"
75 std::vector<double> sum;
89 drain::Logger mout(getImgLog(),
"FlowAverageWindow", __FUNCTION__);
91 mout.
debug2(
"srcTray:\n" , srcTray );
92 mout.
debug2(
"dstTray:\n" , dstTray );
94 if (srcWeight.isEmpty())
95 mout.
debug(
"no src alpha" );
97 if (dstWeight.isEmpty())
98 mout.
debug(
"no dst alpha" );
100 if (!srcTray.checkGeometry()){
101 mout.
special(
"scrTray geom: " , srcTray.getGeometry() );
102 mout.
special(
"content geom: " , srcTray );
103 mout.
error(
"srcTray geometry inconsistent" );
106 if (!dstTray.checkGeometry()){
107 mout.
special(
"dstTray geom: " , dstTray.getGeometry() );
108 mout.
special(
"content geom: " , dstTray );
109 mout.
error(
"dstTray geometry inconsistent" );
116 limiter = this->dst.getConf().getLimiter<
double>();
118 sum.resize(dstTray.size(), 0.0);
124 std::fill(sum.begin(), sum.end(), 0);
131 this->coordinateHandler.set(this->src.getGeometry(), this->src.getCoordinatePolicy());
183 this->traverseMultiChannel(src, dst);
187 const std::string &
getName()
const override {
LogSourc e is the means for a function or any program segment to "connect" to a Log.
Definition Log.h:313
Logger & debug(const TT &... args)
Debug information.
Definition Log.h:667
Logger & special(const TT &... args)
Other useful information.
Definition Log.h:532
Logger & error(const TT &... args)
Echoes.
Definition Log.h:417
Logger & debug2(const TT &... args)
Debug information.
Definition Log.h:677
Window average that preserves the magnitude.
Definition FlowAverageWindowOp.h:173
virtual const std::string & getName() const override
Return the name of an instance.
Definition FlowAverageWindowOp.h:187
Definition FlowAverageWindowOp.h:147
virtual void addPixel(Point2D< int > &p)
Adds a pixel to window statistics. Unvalidated location.
Definition FlowAverageWindowOp.cpp:143
virtual void removePixel(Point2D< int > &p)
Removes a pixel from window statistics. Unvalidated location.
Definition FlowAverageWindowOp.cpp:117
virtual void write()
Write the result in the target image.
Definition FlowAverageWindowOp.cpp:170
Window average that preserves the magnitude.
Definition FlowAverageWindowOp.h:54
void initialize()
Sets class-specific initial values. Does not change general window state (e.g. location)....
Definition FlowAverageWindowOp.h:87
virtual void addPixel(Point2D< int > &p)
Adds a pixel to window statistics. Unvalidated location.
Definition FlowAverageWindowOp.cpp:66
void setImageLimits() const
Sets internal limits corresponding to image geometries. Typically using coordHandler.
Definition FlowAverageWindowOp.h:130
virtual void removePixel(Point2D< int > &p)
Removes a pixel from window statistics. Unvalidated location.
Definition FlowAverageWindowOp.cpp:45
virtual void write()
Write the result in the target image.
Definition FlowAverageWindowOp.cpp:85
void clear()
Clears statistics.
Definition FlowAverageWindowOp.h:123
Container applicable for Channels and Images, with alpha support.
Definition ImageTray.h:266
Template for operators applying pipeline-like sliding window.
Definition SlidingWindowOp.h:57
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:399
Base class for configurations applied in image processing windows, e.g. for operators of type WindowO...
Definition Window.h:55
Point2D< int > location
Current location of this window.
Definition Window.h:521
void setLoopLimits()
Sets the actual traversal range inside the window. Sometimes applied dynamically by reset().
Definition Window.h:606
Class for ensuring that variable of type D remains within limits of type S.
Definition TypeUtils.h:98
Definition DataSelector.cpp:1277