NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
|
This class implements a gaussian smoothing or blurring filter. More...
#include <filtering.hpp>
Public Member Functions | |
GaussianFilter (size_t row, size_t col, double sigma) | |
Filter constructor. Will automatically create the filter kernel. More... | |
virtual | ~GaussianFilter () override |
Filter destructor. Will clear the previously calculated filter kernel. More... | |
virtual double | operator() (size_t i, size_t j) const override |
Override for the operator(). Returns the filter kernel at the desired position. More... | |
virtual mu::value_type | apply (size_t i, size_t j, const mu::value_type &val) const override |
Override for the abstract apply method of the base class. Applies the filter to the value at the selected position and returns the new value. More... | |
Public Member Functions inherited from NumeRe::Filter | |
Filter (size_t row, size_t col) | |
Filter base constructor. Will set the used window sizes. More... | |
virtual | ~Filter () |
Empty virtual abstract destructor. More... | |
virtual double | operator() (size_t i, size_t j) const =0 |
Virtual operator() override. Has to be implemented in the child classes and shall return the kernel value at position (i,j). More... | |
virtual mu::value_type | apply (size_t i, size_t j, const mu::value_type &val) const =0 |
Virtual method for applying the filter to a distinct value. Has to be implemented in all child classes. More... | |
bool | isConvolution () const |
This method returns, whether the current filter is a convolution, ie. whether the returned value may be used directly or if all values of a window have to be accumulated first. More... | |
FilterSettings::FilterType | getType () const |
This method returns the type of the current filter as a value of the FilterType enumeration. More... | |
std::pair< size_t, size_t > | getWindowSize () const |
This method returns the window size of the current filter as a std::pair in the order (row,col). More... | |
FilterBuffer & | getBuffer () |
This method returns the internal filtering buffer queue to store already smoothed points avoiding leakage effects. More... | |
FilterBuffer2D & | get2DBuffer () |
This method returns the internal filtering buffer queue for 2D data to store already smoothed points avoiding leakage effects. More... | |
Private Member Functions | |
void | createKernel (double sigma) |
This method will create the filter's kernel for the selected window size. More... | |
Private Attributes | |
std::vector< std::vector< double > > | m_filterKernel |
Additional Inherited Members | |
Protected Attributes inherited from NumeRe::Filter | |
FilterSettings::FilterType | m_type |
std::pair< size_t, size_t > | m_windowSize |
bool | m_isConvolution |
FilterBuffer | m_buffer |
FilterBuffer2D | m_buffer2D |
This class implements a gaussian smoothing or blurring filter.
Definition at line 367 of file filtering.hpp.
|
inline |
Filter constructor. Will automatically create the filter kernel.
row | |
col |
Definition at line 414 of file filtering.hpp.
References createKernel(), NumeRe::FilterSettings::FILTER_GAUSSIAN, NumeRe::Filter::m_isConvolution, and NumeRe::Filter::m_type.
|
inlineoverridevirtual |
Filter destructor. Will clear the previously calculated filter kernel.
Definition at line 426 of file filtering.hpp.
References m_filterKernel.
|
inlineoverridevirtual |
Override for the abstract apply method of the base class. Applies the filter to the value at the selected position and returns the new value.
i | size_t |
j | size_t |
val | const mu::value_type& |
Implements NumeRe::Filter.
Definition at line 460 of file filtering.hpp.
References mu::isnan(), m_filterKernel, and NumeRe::Filter::m_windowSize.
|
inlineprivate |
This method will create the filter's kernel for the selected window size.
Definition at line 379 of file filtering.hpp.
References m_filterKernel, M_PI, NumeRe::Filter::m_windowSize, and NumeRe::pow2().
Referenced by GaussianFilter().
|
inlineoverridevirtual |
Override for the operator(). Returns the filter kernel at the desired position.
i | size_t |
j | size_t |
Implements NumeRe::Filter.
Definition at line 440 of file filtering.hpp.
References m_filterKernel, and NumeRe::Filter::m_windowSize.
|
private |
Definition at line 370 of file filtering.hpp.
Referenced by apply(), createKernel(), operator()(), and ~GaussianFilter().