Horus Doc || Global Function Guide || General documentation   | Function documentation  

HxConvGauss2d

Synopsis

HxImageRep HxConvGauss2d (HxImageRep img, double sigmax, int orderDerivx, double truncationx, double sigmay, int orderDerivy, double truncationy)

Input

HxImageRep img
The image you want to convolve with a Gaussian kernel. The used Gaussian kernel is composed from two seperate kernels, one for the x-direction and one for the y-direction.

double sigmax
The sigma of the Gaussian kernel in the x-direction.

int orderDerivx
The order of the derivative of the Gaussian kernel in the x-direction.

double trunctationx
This parameter determines at how many sigma the Gaussian filter is clipped in the x-direction.

double sigmay
The sigma of the Gaussian kernel in the y-direction.

int orderDerivy
The order of the derivative of the Gaussian kernel in the y-direction.

double truncationy
This parameter determines at how many sigma the Gaussian filter is clipped in the y-direction.

Return value

HxImageRep
The result of convolving the input image with a Gaussian kernel as described by the parameters sigmax, orderDerivx, truncationx, sigmay, orderDerivy and trunctiony.

Description

The function HxConvGauss2d convolves 2D-images with a Gaussian filter funtion. The filter function is separated in the x- and y-direction, where the sigma and the order of the derivative in both directions can be given seperately. The truncation (in both directions) determines the size of the filter in sigma (of the particular direction), where the filter size, in sigma, is 2 times the truncation plus 1. For vector images, each channel is convolved separately with the Gaussian kernel.

Remarks

Valid image types
All 2D types of images are allowed for this function.

Valid values for the parameters
sigmax, sigmay, truncationx and truncationy should both be greater than zero. orderDerivx and orderDerivy should be larger or equal to zero.

Border handling
This function uses MIRRORED border handling, see the section on Border handling.

Examples

Convolving with a Gaussian kernel using HxConvGauss2d

#include "HxImageRepGlobalFuncs.h"
#include "HxImageRep.h"

HxImageRep HxConvGauss2dExample1(HxImageRep img) {
   img = HxImageAsDouble(img);
   img = HxConvGauss2d(img, 3.0, 0.0, 3.0, 3.0, 1.0, 3.0);
   img = HxContrastStretch(img, 255.0);
   img = HxImageAsByte(img);

   return img;
}

int main(int argc, char* argv[])
{
    HxImageRep im1 = HxMakeFromFile(argv[1]);
    im1 = HxConvGauss2dExample1(im1);
    HxWriteFile(im1, argv[2]);

    return 0;
}

exampleImage1.gif

Input image for the HxConvGauss2d example.

HxConvGauss2dResult1.gif

Output image of the HxConvGauss2d example.

In this example we convolve the input image with a Gaussian filter. The sigma of this filter in the x-direction is 3.0, the order of the derivative in this direction is 0 and the truncation width is 3.0 (in sigmas). In the y-direction the sigma of the filter is 3.0, the order of the derivative is 1 and the truncation width is 3.0.

See also

HxGaussDerivative2d, HxConvolution, HxGauss, HxConvGauss3d,

Keywords

Filter, Convolution, Gauss,


Generated on Mon Jan 27 15:44:59 2003 for GlobalFunctionGuide by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001