STIRA  0.1
Public Types | Public Member Functions | Static Public Member Functions | List of all members
stira::filter::GaussConvolve Class Reference

Convolves image with Gaussian PSF. More...

#include <GaussConvolve.h>

Public Types

enum  FilterType { FFT_BASED, RECURSIVE_BASED }
 identifier which type of gausssian filter this is
 
enum  DerivativeType {
  DERIVATIVE_NONE, DERIVATIVE_X, DERIVATIVE_Y, DERIVATIVE_XX,
  DERIVATIVE_YY, DERIVATIVE_XY
}
 identifier which type of gausssian filter this is
 

Public Member Functions

 GaussConvolve ()
 constructor
 
 ~GaussConvolve ()
 destructor
 

Static Public Member Functions

static ArrayGrid< double > * CreateBlurredBars (int width, int height, int barWidth, double sigmaBlurMax)
 generate test pattern of horizontal bars that become gradually more and more blurred More...
 
static ArrayGrid< double > * Convolve (ArrayGrid< double > *pImage, double sigma, FilterType myType=FFT_BASED)
 Applies Gaussian filter to grid Generates new grid, which the caller is responsible for. More...
 
static ImageConvolve (Image *pImage, double sigma, FilterType myType=FFT_BASED)
 Applies Gaussian filter to image Generates new image, which the caller is responsible for. More...
 
static ArrayGrid< double > * DerivativeConvolveFFT (ArrayGrid< double > *pGridIn, double sigmaX, double sigmaY, DerivativeType myType)
 Applies Gaussian filter or its derivatives (applied in Fourier domain) to a grid Generates new grid with filter response, which the caller is responsible for. More...
 
static ArrayGrid< double > * DerivativeConvolveSeparable (ArrayGrid< double > *pGridIn, double sigma, DerivativeType myType, GridExtender< double >::ExtensionType myExtensionType=GridExtender< double >::EXTEND_MIRROR)
 Applies Gaussian filter or its derivatives (applied in spatial domain by a separable filter in x and y) to grid Generates new grid with filter response, which the caller is responsible for. More...
 
static ArrayGrid< double > * ConvolveSeparable (ArrayGrid< double > *pGridIn, double sigma)
 Simple interface to straightforward Gaussian filter (applied in spatial domain by a separable filter in x and y) to grid Generates new grid with filter response, which the caller is responsible for. More...
 
static ImageDerivativeConvolveFFT (Image *pImageIn, double sigma, DerivativeType myType, GridExtender< double >::ExtensionType myExtensionType=GridExtender< double >::EXTEND_MIRROR)
 Applies Gaussian filter or its derivatives (applied in Fourier domain) to image Generates new image with filter response, which the caller is responsible for. More...
 
static ImageDerivativeConvolveSeparable (Image *pImageIn, double sigma, DerivativeType myType, GridExtender< double >::ExtensionType myExtensionType=GridExtender< double >::EXTEND_MIRROR)
 Applies Gaussian filter or its derivatives (applied in spatial domain by a separable filter in x and y) to image Generates new image with filter response, which the caller is responsible for. More...
 
static ImageConvolveSeparable (Image *pImageIn, double sigma)
 Simple interface to straightforward Gaussian filter (applied in spatial domain by a separable filter in x and y) to grid Generates new image with filter response, which the caller is responsible for. More...
 
static ArrayGrid< double > * GenerateGaussianPSF (int width, int height, double sigmaX, double sigmaY)
 Generates a Gaussian filter kernel Generates new image, which the caller is responsible for. More...
 
static ArrayGrid< double > * GenerateGaussianPSF (int width, int height, double sigma1, double sigma2, double rho)
 Generates a Gaussian filter kernel Generates new image, which the caller is responsible for. More...
 
static ArrayGrid< double > * UpsampleGaussianInterpolated (ArrayGrid< double > *pGridIn, int upscalefactor)
 Generates an upscaled grid, where all pixels are interpolated with a Gaussian function Generates new grid with filter response, which the caller is responsible for. More...
 

Detailed Description

Convolves image with Gaussian PSF.

Recursive implementation based on:

article{ young95recursive, author = {Young, I. T. and {van~Vliet}, L. J.}, title = {Recursive implementation of the Gaussian filter}, volume = {44}, number = {2}, pages = {139-151}, year = {1995}, url = {http://citeseer.ist.psu.edu/young95recursive.html} }

Member Function Documentation

ArrayGrid< double > * stira::filter::GaussConvolve::Convolve ( ArrayGrid< double > *  pImage,
double  sigma,
FilterType  myType = FFT_BASED 
)
static

Applies Gaussian filter to grid Generates new grid, which the caller is responsible for.

Parameters
pImageinput grid
sigmasigma for the gaussian filter
myTypehow to compute the filtering: recursively or in Fourier domain

Referenced by stira::degradationestimation::BlurEstimatorHu::Run(), and stira::contrastenhance::Retinex::~Retinex().

Image * stira::filter::GaussConvolve::Convolve ( Image pImage,
double  sigma,
FilterType  myType = FFT_BASED 
)
static

Applies Gaussian filter to image Generates new image, which the caller is responsible for.

Parameters
pImageinput image
sigmasigma for the gaussian filter
myTypehow to compute the filtering: recursively or in Fourier domain
ArrayGrid< double > * stira::filter::GaussConvolve::ConvolveSeparable ( ArrayGrid< double > *  pGridIn,
double  sigma 
)
static

Simple interface to straightforward Gaussian filter (applied in spatial domain by a separable filter in x and y) to grid Generates new grid with filter response, which the caller is responsible for.

Parameters
pGridIninput grid
sigmasigma for the gaussian filter

Referenced by stira::deconvolve::WienerDeconvolve::~WienerDeconvolve().

Image * stira::filter::GaussConvolve::ConvolveSeparable ( Image pImageIn,
double  sigma 
)
static

Simple interface to straightforward Gaussian filter (applied in spatial domain by a separable filter in x and y) to grid Generates new image with filter response, which the caller is responsible for.

Parameters
pImageIninput image
sigmasigma for the gaussian filter
ArrayGrid< double > * stira::filter::GaussConvolve::CreateBlurredBars ( int  width,
int  height,
int  barWidth,
double  sigmaBlurMax 
)
static

generate test pattern of horizontal bars that become gradually more and more blurred

Parameters
widthwidth of the test pattern
heightheight of the test pattern
barWidthwidth of a bar in the image
sigmaBlurMaxthe maximal blur applied to the bars (at the right of the image)

References stira::filter::SeparableFilter::BasicFilter1D(), stira::common::MathUtils::Gaussian(), stira::common::MathUtils::GaussianFirstDerivativeX1D(), stira::common::MathUtils::GaussianSecondDerivateX1D(), stira::imagetools::GridGenerator::GenerateBars(), stira::imagedata::ArrayGrid< T >::GetValue(), and stira::imagedata::ArrayGrid< T >::SetValue().

ArrayGrid< double > * stira::filter::GaussConvolve::DerivativeConvolveFFT ( ArrayGrid< double > *  pGridIn,
double  sigmaX,
double  sigmaY,
DerivativeType  myType 
)
static
Image * stira::filter::GaussConvolve::DerivativeConvolveFFT ( Image pImageIn,
double  sigma,
DerivativeType  myType,
GridExtender< double >::ExtensionType  myExtensionType = GridExtender<double>::EXTEND_MIRROR 
)
static

Applies Gaussian filter or its derivatives (applied in Fourier domain) to image Generates new image with filter response, which the caller is responsible for.

Parameters
pImageIninput grid
sigmasigma for the gaussian filter
myTypewhich derivative kernel to use for the filtering
myExtensionTypeidentifies how borders should be extended (mirror, tiled periodically, zero's)

References stira::imagedata::Image::AddBand(), stira::imagetools::ImageTools::CropBorder(), stira::imagedata::Image::GetBands(), stira::imagedata::Image::GetHeight(), stira::imagedata::Image::GetImageName(), stira::imagedata::Image::GetNumberOfBands(), stira::imagedata::Image::GetWidth(), stira::imagetools::ImageTools::MirrorBorder(), stira::imagetools::ImageTools::PaddBorder(), and stira::imagedata::Image::SetImageName().

ArrayGrid< double > * stira::filter::GaussConvolve::DerivativeConvolveSeparable ( ArrayGrid< double > *  pGridIn,
double  sigma,
DerivativeType  myType,
GridExtender< double >::ExtensionType  myExtensionType = GridExtender<double>::EXTEND_MIRROR 
)
static

Applies Gaussian filter or its derivatives (applied in spatial domain by a separable filter in x and y) to grid Generates new grid with filter response, which the caller is responsible for.

Parameters
pGridIninput grid
sigmasigma for the gaussian filter
myTypewhich derivative kernel to use for the filtering
myExtensionTypeidentifies how borders should be extended (mirror, tiled periodically, zero's)

References stira::filter::SeparableFilter::RunRowColumn().

Image * stira::filter::GaussConvolve::DerivativeConvolveSeparable ( Image pImageIn,
double  sigma,
DerivativeType  myType,
GridExtender< double >::ExtensionType  myExtensionType = GridExtender<double>::EXTEND_MIRROR 
)
static

Applies Gaussian filter or its derivatives (applied in spatial domain by a separable filter in x and y) to image Generates new image with filter response, which the caller is responsible for.

Parameters
pImageIninput image
sigmasigma for the gaussian filter
myTypewhich derivative kernel to use for the filtering
myExtensionTypeidentifies how borders should be extended (mirror, tile, black)

References stira::imagedata::Image::AddBand(), stira::imagedata::Image::GetBands(), stira::imagedata::Image::GetHeight(), stira::imagedata::Image::GetImageName(), stira::imagedata::Image::GetNumberOfBands(), stira::imagedata::Image::GetWidth(), and stira::imagedata::Image::SetImageName().

static ArrayGrid<double>* stira::filter::GaussConvolve::GenerateGaussianPSF ( int  width,
int  height,
double  sigmaX,
double  sigmaY 
)
static

Generates a Gaussian filter kernel Generates new image, which the caller is responsible for.

Parameters
widthwidth of image to generate
heightheight of image to generate
sigmaXsigma in X direction for the gaussian filter
sigmaYsigma in Y direction for the gaussian filter
static ArrayGrid<double>* stira::filter::GaussConvolve::GenerateGaussianPSF ( int  width,
int  height,
double  sigma1,
double  sigma2,
double  rho 
)
static

Generates a Gaussian filter kernel Generates new image, which the caller is responsible for.

Parameters
widthwidth of image to generate
heightheight of image to generate
sigma1sigma of x for the gaussian filter
sigma2sigma of y for the gaussian filter
rhocorrelation coefficient, must be between -1 and 1
ArrayGrid< double > * stira::filter::GaussConvolve::UpsampleGaussianInterpolated ( ArrayGrid< double > *  pGridIn,
int  upscalefactor 
)
static

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