Synopsis
HxImageRep HxConvGauss2d (HxImageRep img, double sigmax, int orderDerivx, double truncationx, double sigmay, int orderDerivy, double truncationy)
Input
HxImageRep img
double sigmax
int orderDerivx
double trunctationx
double sigmay
int orderDerivy
double truncationy
Return value
HxImageRep
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
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; }
Input image for the HxConvGauss2d example.
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,