FilterLaplace Class Reference

Laplacian filter. More...

#include <filters/laplace.h>

Inheritance diagram for FilterLaplace:

List of all members.


Public Member Functions

 FilterLaplace ()
 Constructor.
 FilterLaplace (float sigma, unsigned int size, float scale)
 Constructor.
 ~FilterLaplace ()
 Destructor.
virtual void apply ()
 Apply the filter.

Static Public Member Functions

static void calculate_kernel (int *kernel_buffer, float sigma, unsigned int size, float scale)
 Calculate a Laplacian of Gaussian kernel.

Detailed Description

Laplacian filter.

Laplacian of Gaussian filter.

Author:
Tim Niemueller

Definition at line 33 of file laplace.h.


Constructor & Destructor Documentation

FilterLaplace::FilterLaplace (  ) 

Constructor.

Definition at line 39 of file laplace.cpp.

FilterLaplace::FilterLaplace ( float  sigma,
unsigned int  size,
float  scale 
)

Constructor.

Parameters:
sigma sigma for Laplacian
size size of kernel
scale scale factor

Definition at line 51 of file laplace.cpp.

References calculate_kernel().

FilterLaplace::~FilterLaplace (  ) 

Destructor.

Definition at line 61 of file laplace.cpp.


Member Function Documentation

void FilterLaplace::apply (  )  [virtual]

Apply the filter.

Apply the filter to the given source and destination buffers with given width and height and orientation (ori may be ignored for some filters).

Implements Filter.

Definition at line 70 of file laplace.cpp.

References Filter::dst, Filter::dst_roi, ROI::height, ROI::line_step, ROI::pixel_step, Filter::src, Filter::src_roi, ROI::start, ROI::width, fawkes::point_t::x, and fawkes::point_t::y.

void FilterLaplace::calculate_kernel ( int *  kernel,
float  sigma,
unsigned int  size,
float  scale 
) [static]

Calculate a Laplacian of Gaussian kernel.

The kernel is calculated with the formula

\[ roundf( \frac{-1}{\pi * \sigma^4} * ( 1 - \frac{w^2 + h^2}{2 * \sigma^2} ) * e^{-\frac{w^2 + h^2}{2 * \sigma^2}} * \mathtt{scale} ) \]

Parameters:
kernel buffer contains kernel upon return
sigma sigma for formula
size kernel is of quadratic size $\mathtt{size} \times \mathtt{size}$
scale scale parameter in formula

Definition at line 143 of file laplace.cpp.

Referenced by FilterLaplace().


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