ClassesClassesClassesClasses | | | | Operators

gauss_filtergauss_filterGaussFiltergauss_filterGaussFilterGaussFilter (Operator)

Name

gauss_filtergauss_filterGaussFiltergauss_filterGaussFilterGaussFilter — Smooth using discrete gauss functions.

Signature

gauss_filter(Image : ImageGauss : Size : )

Herror gauss_filter(const Hobject Image, Hobject* ImageGauss, const Hlong Size)

Herror T_gauss_filter(const Hobject Image, Hobject* ImageGauss, const Htuple Size)

Herror gauss_filter(Hobject Image, Hobject* ImageGauss, const HTuple& Size)

HImage HImage::GaussFilter(const HTuple& Size) const

HImageArray HImageArray::GaussFilter(const HTuple& Size) const

void GaussFilter(const HObject& Image, HObject* ImageGauss, const HTuple& Size)

HImage HImage::GaussFilter(Hlong Size) const

void HOperatorSetX.GaussFilter(
[in] IHUntypedObjectX* Image, [out] IHUntypedObjectX*ImageGauss, [in] VARIANT Size)

IHImageX* HImageX.GaussFilter([in] Hlong Size)

static void HOperatorSet.GaussFilter(HObject image, out HObject imageGauss, HTuple size)

HImage HImage.GaussFilter(int size)

Description

The operator gauss_filtergauss_filterGaussFiltergauss_filterGaussFilterGaussFilter smoothes images using the discrete Gaussian, a discrete approximation of the Gaussian function,

The smoothing effect increases with increasing filter size. The following filter sizes (SizeSizeSizeSizeSizesize) are supported (the sigma value of the gauss function is indicated in brackets):

    3    (0.600)
    5    (1.075)
    7    (1.550)
    9    (2.025)
    11   (2.550)
For border treatment the gray values of the images are reflected at the image borders. Notice that, contrary to the operator gauss_imagegauss_imageGaussImagegauss_imageGaussImageGaussImage, the relationship between the filter mask size and its respective value for the sigma parameter is linear.

The operator binomial_filterbinomial_filterBinomialFilterbinomial_filterBinomialFilterBinomialFilter can be used as an alternative to gauss_filtergauss_filterGaussFiltergauss_filterGaussFilterGaussFilter. binomial_filterbinomial_filterBinomialFilterbinomial_filterBinomialFilterBinomialFilter is significantly faster than gauss_filtergauss_filterGaussFiltergauss_filterGaussFilterGaussFilter. It should be noted that the mask size in binomial_filterbinomial_filterBinomialFilterbinomial_filterBinomialFilterBinomialFilter does not lead to the same amount of smoothing as the mask size in gauss_filtergauss_filterGaussFiltergauss_filterGaussFilterGaussFilter. Corresponding mask sizes can be determined based on the respective values of the Gaussian smoothing parameter sigma.

gauss_filtergauss_filterGaussFiltergauss_filterGaussFilterGaussFilter can be executed on OpenCL devices for all supported image types. However, the OpenCL impelementation can produce slightly different results from the scalar implementation.

Attention

In order to be able to process gauss_filtergauss_filterGaussFiltergauss_filterGaussFilterGaussFilter on on OpenCL device, ImageImageImageImageImageimage must be at least 64 pixels in both width and height.

Note that filter operators may return unexpected results if an image with a reduced domain is used as input. Please refer to the chapter Filters.

Parallelization

Parameters

ImageImageImageImageImageimage (input_object)  (multichannel-)image(-array) objectHImageHImageHImageHImageXHobject (byte* / int2* / uint2* / int4* / real*) *allowed for compute devices

Image to be smoothed.

ImageGaussImageGaussImageGaussImageGaussImageGaussimageGauss (output_object)  (multichannel-)image(-array) objectHImageHImageHImageHImageXHobject * (byte / int2 / uint2 / int4 / real)

Filtered image.

SizeSizeSizeSizeSizesize (input_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Required filter size.

Default value: 5

List of values: 3, 5, 7, 9, 11

Example (HDevelop)

gauss_filter(Input,Gauss,7)
regiongrowing(Gauss,Segments,7,7,5,100)

Example (C)

gauss_filter(Input,&Gauss,7,);
regiongrowing(Gauss,&Segments,7,7,5,100,);

Example (HDevelop)

gauss_filter(Input,Gauss,7)
regiongrowing(Gauss,Segments,7,7,5,100)

Example (HDevelop)

gauss_filter(Input,Gauss,7)
regiongrowing(Gauss,Segments,7,7,5,100)

Example (HDevelop)

gauss_filter(Input,Gauss,7)
regiongrowing(Gauss,Segments,7,7,5,100)

Example (HDevelop)

gauss_filter(Input,Gauss,7)
regiongrowing(Gauss,Segments,7,7,5,100)

Complexity

For each pixel: O(Size * 2).

Result

If the parameter values are correct the operator gauss_filtergauss_filterGaussFiltergauss_filterGaussFilterGaussFilter returns the value 2 (H_MSG_TRUE). The behavior in case of empty input (no input images available) is set via the operator set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>). If necessary an exception is raised.

Possible Predecessors

read_imageread_imageReadImageread_imageReadImageReadImage, grab_imagegrab_imageGrabImagegrab_imageGrabImageGrabImage

Possible Successors

regiongrowingregiongrowingRegiongrowingregiongrowingRegiongrowingRegiongrowing, thresholdthresholdThresholdthresholdThresholdThreshold, sub_imagesub_imageSubImagesub_imageSubImageSubImage, dyn_thresholddyn_thresholdDynThresholddyn_thresholdDynThresholdDynThreshold, auto_thresholdauto_thresholdAutoThresholdauto_thresholdAutoThresholdAutoThreshold

Alternatives

binomial_filterbinomial_filterBinomialFilterbinomial_filterBinomialFilterBinomialFilter, smooth_imagesmooth_imageSmoothImagesmooth_imageSmoothImageSmoothImage, derivate_gaussderivate_gaussDerivateGaussderivate_gaussDerivateGaussDerivateGauss, isotropic_diffusionisotropic_diffusionIsotropicDiffusionisotropic_diffusionIsotropicDiffusionIsotropicDiffusion

See also

mean_imagemean_imageMeanImagemean_imageMeanImageMeanImage, anisotropic_diffusionanisotropic_diffusionAnisotropicDiffusionanisotropic_diffusionAnisotropicDiffusionAnisotropicDiffusion, sigma_imagesigma_imageSigmaImagesigma_imageSigmaImageSigmaImage, gen_lowpassgen_lowpassGenLowpassgen_lowpassGenLowpassGenLowpass

Module

Foundation


ClassesClassesClassesClasses | | | | Operators