Operator Reference

gauss_imagegauss_imageGaussImageGaussImagegauss_image (Operator)

gauss_imagegauss_imageGaussImageGaussImagegauss_image — Smooth an image using discrete Gaussian functions.

Warning

gauss_imagegauss_imageGaussImageGaussImagegauss_image is obsolete and is only provided for reasons of backward compatibility. New applications should use the operator gauss_filtergauss_filterGaussFilterGaussFiltergauss_filter instead.

Signature

gauss_image(Image : ImageGauss : Size : )

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

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

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

HImage HImage::GaussImage(Hlong Size) const

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

HImage HImage.GaussImage(int size)

def gauss_image(image: HObject, size: int) -> HObject

Description

The operator gauss_imagegauss_imageGaussImageGaussImagegauss_image smoothes images using the discrete Gaussian. The smoothing effect increases with increasing filter size. The following filter sizes (SizeSizeSizesizesize) are supported (the sigma value of the Gauss function is indicated in brackets):

  • 3 (0.65)

  • 5 (0.87)

  • 7 (1.43)

  • 9 (1.88)

  • 11 (2.31)

For border treatment the gray values of the images are reflected at the image borders.

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

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

For an explanation of the concept of smoothing filters see the introduction of chapter Filters / Smoothing.

Attention

In order to be able to process gauss_imagegauss_imageGaussImageGaussImagegauss_image on an OpenCL device, ImageImageImageimageimage 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.

Execution Information

  • Supports OpenCL compute devices.
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).
  • Multithreading scope: global (may be called from any thread).
  • Automatically parallelized on tuple level.
  • Automatically parallelized on channel level.
  • Automatically parallelized on domain level.

Parameters

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

Image to be smoothed.

ImageGaussImageGaussImageGaussimageGaussimage_gauss (output_object)  (multichannel-)image(-array) objectHImageHObjectHObjectHobject * (byte / int2 / uint2 / int4 / real)

Filtered image.

SizeSizeSizesizesize (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Required filter size.

Default: 5

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

Example (HDevelop)

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

Example (C)

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

Example (HDevelop)

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

Example (HDevelop)

gauss_image(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_imagegauss_imageGaussImageGaussImagegauss_image 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>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>). If necessary an exception is raised.

Module

Foundation