HALCON Reference Manual 10.0.2
Table of Contents / Filters / Smoothing ClassesClassesClasses | | | Operators

sigma_imagesigma_imagesigma_imageSigmaImageSigmaImage (Operator)

Name

sigma_imagesigma_imagesigma_imageSigmaImageSigmaImage — Non-linear smoothing with the sigma filter.

Signature

sigma_image(Image : ImageSigma : MaskHeight, MaskWidth, Sigma : )

Herror sigma_image(const Hobject Image, Hobject* ImageSigma, const Hlong MaskHeight, const Hlong MaskWidth, const Hlong Sigma)

Herror T_sigma_image(const Hobject Image, Hobject* ImageSigma, const Htuple MaskHeight, const Htuple MaskWidth, const Htuple Sigma)

Herror sigma_image(Hobject Image, Hobject* ImageSigma, const HTuple& MaskHeight, const HTuple& MaskWidth, const HTuple& Sigma)

HImage HImage::SigmaImage(const HTuple& MaskHeight, const HTuple& MaskWidth, const HTuple& Sigma) const

HImageArray HImageArray::SigmaImage(const HTuple& MaskHeight, const HTuple& MaskWidth, const HTuple& Sigma) const

void HOperatorSetX.SigmaImage(
[in] IHUntypedObjectX* Image, [out] IHUntypedObjectX*ImageSigma, [in] VARIANT MaskHeight, [in] VARIANT MaskWidth, [in] VARIANT Sigma)

IHImageX* HImageX.SigmaImage(
[in] Hlong MaskHeight, [in] Hlong MaskWidth, [in] Hlong Sigma)

static void HOperatorSet.SigmaImage(HObject image, out HObject imageSigma, HTuple maskHeight, HTuple maskWidth, HTuple sigma)

HImage HImage.SigmaImage(int maskHeight, int maskWidth, int sigma)

Description

The operator sigma_imagesigma_imagesigma_imageSigmaImageSigmaImage carries out a non-linear smoothing of the gray values of all input images (ImageImageImageImageimage). All pixels in a rectangular window (MaskHeight x MaskWidth) are used to determine the new gray value of the central pixel of this window. First, the gray value standard deviation of all pixels in the window is calculated. Then, all pixels of the window with a gray value that differs from the gray value of the central pixel by less than SigmaSigmaSigmaSigmasigma times this standard deviation are used to calculate the new gray value of the central pixel. The gray value of the central pixel is the average of the gray values of the selected pixels. If no pixel could be selected for the averaging of the gray values, the gray value of the central pixel remains unchanged.

Attention

If even values instead of odd values are given for MaskHeightMaskHeightMaskHeightMaskHeightmaskHeight or MaskWidthMaskWidthMaskWidthMaskWidthmaskWidth, the routine uses the next larger odd values instead (this way the center of the filter mask is always explicitly determined).

Parallelization

Parameters

ImageImageImageImageimage (input_object)  (multichannel-)image(-array) objectHImageHImageHImageXHobject (byte / cyclic / int1 / int2 / uint2 / int4 / real)

Image to be smoothed.

ImageSigmaImageSigmaImageSigmaImageSigmaimageSigma (output_object)  (multichannel-)image(-array) objectHImageHImageHImageXHobject * (byte / cyclic / int1 / int2 / uint2 / int4 / real)

Smoothed image.

MaskHeightMaskHeightMaskHeightMaskHeightmaskHeight (input_control)  extent.y HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Height of the mask (number of lines).

Default value: 5

Suggested values: 3, 5, 7, 9, 11, 13, 15

Typical range of values: 3 ≤ MaskHeight MaskHeight MaskHeight MaskHeight maskHeight ≤ 101

Minimum increment: 2

Recommended increment: 2

Restriction: odd(MaskHeight)

MaskWidthMaskWidthMaskWidthMaskWidthmaskWidth (input_control)  extent.x HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Width of the mask (number of columns).

Default value: 5

Suggested values: 3, 5, 7, 9, 11, 13, 15

Typical range of values: 3 ≤ MaskWidth MaskWidth MaskWidth MaskWidth maskWidth ≤ 101

Minimum increment: 2

Recommended increment: 2

Restriction: odd(MaskWidth)

SigmaSigmaSigmaSigmasigma (input_control)  integer HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Max. deviation to the average.

Default value: 3

Suggested values: 3, 5, 7, 9, 11, 20, 30, 50

Typical range of values: 0 ≤ Sigma Sigma Sigma Sigma sigma ≤ 255

Minimum increment: 1

Recommended increment: 2

Example (HDevelop)

read_image(Image,'fabrik')
sigma_image(Image,ImageSigma,5,5,3)
disp_image(ImageSigma,WindowHandle)

Example (C)

read_image(&Image,"fabrik");
sigma_image(Image,&ImageSigma,5,5,3);
disp_image(ImageSigma,WindowHandle);

Example (HDevelop)

read_image(Image,'fabrik')
sigma_image(Image,ImageSigma,5,5,3)
disp_image(ImageSigma,WindowHandle)

Example (HDevelop)

read_image(Image,'fabrik')
sigma_image(Image,ImageSigma,5,5,3)
disp_image(ImageSigma,WindowHandle)

Example (HDevelop)

read_image(Image,'fabrik')
sigma_image(Image,ImageSigma,5,5,3)
disp_image(ImageSigma,WindowHandle)

Complexity

For each pixel: O(MaskHeight*MaskWidth).

Result

If the parameter values are correct the operator sigma_imagesigma_imagesigma_imageSigmaImageSigmaImage 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>)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_imageread_imageReadImageReadImage

Possible Successors

thresholdthresholdthresholdThresholdThreshold, dyn_thresholddyn_thresholddyn_thresholdDynThresholdDynThreshold, regiongrowingregiongrowingregiongrowingRegiongrowingRegiongrowing

Alternatives

anisotropic_diffusionanisotropic_diffusionanisotropic_diffusionAnisotropicDiffusionAnisotropicDiffusion, rank_imagerank_imagerank_imageRankImageRankImage

See also

smooth_imagesmooth_imagesmooth_imageSmoothImageSmoothImage, binomial_filterbinomial_filterbinomial_filterBinomialFilterBinomialFilter, gauss_imagegauss_imagegauss_imageGaussImageGaussImage, mean_imagemean_imagemean_imageMeanImageMeanImage

References

R. Haralick, L. Shapiro; “Computer and Robot Vision”; Addison-Wesley, 1992, Seite 325

Module

Foundation


Table of Contents / Filters / Smoothing ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH