NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
NumeRe::GaussianFilter Class Reference

This class implements a gaussian smoothing or blurring filter. More...

#include <filtering.hpp>

Inheritance diagram for NumeRe::GaussianFilter:
Collaboration diagram for NumeRe::GaussianFilter:

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...
 
FilterBuffergetBuffer ()
 This method returns the internal filtering buffer queue to store already smoothed points avoiding leakage effects. More...
 
FilterBuffer2Dget2DBuffer ()
 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
 

Detailed Description

This class implements a gaussian smoothing or blurring filter.

Definition at line 367 of file filtering.hpp.

Constructor & Destructor Documentation

◆ GaussianFilter()

NumeRe::GaussianFilter::GaussianFilter ( size_t  row,
size_t  col,
double  sigma 
)
inline

Filter constructor. Will automatically create the filter kernel.

Parameters
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.

Here is the call graph for this function:

◆ ~GaussianFilter()

virtual NumeRe::GaussianFilter::~GaussianFilter ( )
inlineoverridevirtual

Filter destructor. Will clear the previously calculated filter kernel.

Definition at line 426 of file filtering.hpp.

References m_filterKernel.

Member Function Documentation

◆ apply()

virtual mu::value_type NumeRe::GaussianFilter::apply ( size_t  i,
size_t  j,
const mu::value_type val 
) const
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.

Parameters
isize_t
jsize_t
valconst mu::value_type&
Returns
virtual mu::value_type

Implements NumeRe::Filter.

Definition at line 460 of file filtering.hpp.

References mu::isnan(), m_filterKernel, and NumeRe::Filter::m_windowSize.

Here is the call graph for this function:

◆ createKernel()

void NumeRe::GaussianFilter::createKernel ( double  sigma)
inlineprivate

This method will create the filter's kernel for the selected window size.

Returns
void

Definition at line 379 of file filtering.hpp.

References m_filterKernel, M_PI, NumeRe::Filter::m_windowSize, and NumeRe::pow2().

Referenced by GaussianFilter().

Here is the call graph for this function:

◆ operator()()

virtual double NumeRe::GaussianFilter::operator() ( size_t  i,
size_t  j 
) const
inlineoverridevirtual

Override for the operator(). Returns the filter kernel at the desired position.

Parameters
isize_t
jsize_t
Returns
double

Implements NumeRe::Filter.

Definition at line 440 of file filtering.hpp.

References m_filterKernel, and NumeRe::Filter::m_windowSize.

Member Data Documentation

◆ m_filterKernel

std::vector<std::vector<double> > NumeRe::GaussianFilter::m_filterKernel
private

Definition at line 370 of file filtering.hpp.

Referenced by apply(), createKernel(), operator()(), and ~GaussianFilter().


The documentation for this class was generated from the following file: