Gauss operator for a template image. More...
#include <GaussOperator.h>
Public Member Functions | |
virtual void | apply (const SingleElementImage< T > &iImg, SingleElementImage< T > &oImg) |
Performs a Gaussian filter on the given input image. | |
GaussOperator (float sigma=3.0f, int maskRadius=0) | |
Creates the kernel for the convolution. | |
float | getSigma () const |
virtual | ~GaussOperator () |
Deletes the kernel. | |
Private Attributes | |
double * | kernel |
int | maskradius |
float | sigma |
Gauss operator for a template image.
This class is a image-to-image operator that performs a convolution with a gauss kernel on a SingleElementImage. For using this operator, a variable of the type double has to be casted into the type of the SingleElementImage. Therefore, this type has to implement a corresponding cast operator.
Definition at line 33 of file GaussOperator.h.
puma2::GaussOperator< T >::GaussOperator | ( | float | sigma = 3.0f , |
int | maskRadius = 0 |
||
) |
Creates the kernel for the convolution.
The constructor creates a kernel for computing the Gaussian filter. The size of the kernel is given by the optional paramater maskSize
. If this parameter is not set or has an invalid value, the mask size will be automatically computed, using the given sigma
. If the standard deviation sigma has an invalid value, it will be put in the valid range.
sigma | used for computing the Gaussian kernel as well as its size. The minimum value is 0.5, the maximum value is 10.0. If the parameter is not within this range, it will be corrected. |
maskSize | The size of the Gaussian kernel. The minimum value is 3, the maximum value is 61. If the set value is not within this range (or if it is not set at all), it will be computed automatically, according to the value of sigma. |
Definition at line 104 of file GaussOperator.h.
puma2::GaussOperator< T >::~GaussOperator | ( | ) | [virtual] |
Deletes the kernel.
The destructor deletes the private kernel, that was used for the convolution.
Definition at line 144 of file GaussOperator.h.
void puma2::GaussOperator< T >::apply | ( | const SingleElementImage< T > & | iImg, |
SingleElementImage< T > & | oImg | ||
) | [virtual] |
Performs a Gaussian filter on the given input image.
This method performs a Gaussian filter on the given input image iImg
. The result is stored via call by reference in the paramater oImg
.
iImg | The input image. |
oImg | The output image. |
Implements puma2::ImageToImageOperator< SingleElementImage< T >, SingleElementImage< T > >.
Definition at line 153 of file GaussOperator.h.
float puma2::GaussOperator< T >::getSigma | ( | ) | const [inline] |
Definition at line 97 of file GaussOperator.h.
double* puma2::GaussOperator< T >::kernel [private] |
The gaussian kernel, used for the convolution. Since the gaussian kernel is separable, the kernel is stored as a 1D-array.
Definition at line 53 of file GaussOperator.h.
int puma2::GaussOperator< T >::maskradius [private] |
The size of the gaussian mask. The mask itself is created as a linear mask in the constructor.
Definition at line 42 of file GaussOperator.h.
float puma2::GaussOperator< T >::sigma [private] |
The standard deviation, used for the gaussian kernel.
Definition at line 47 of file GaussOperator.h.