Skip to content

sigma_imageSigmaImageSigmaImagesigma_imagesigma_imageπŸ”—

Short descriptionπŸ”—

sigma_imageSigmaImageSigmaImagesigma_imagesigma_image β€” Non-linear smoothing with the sigma filter.

SignatureπŸ”—

sigma_image( image Image, out image ImageSigma, extent.y MaskHeight, extent.x MaskWidth, integer Sigma )void SigmaImage( const HObject& Image, HObject* ImageSigma, const HTuple& MaskHeight, const HTuple& MaskWidth, const HTuple& Sigma )static void HOperatorSet.SigmaImage( HObject image, out HObject imageSigma, HTuple maskHeight, HTuple maskWidth, HTuple sigma )def sigma_image( image: HObject, mask_height: int, mask_width: int, sigma: int ) -> HObject

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 )

HImage HImage::SigmaImage( Hlong MaskHeight, Hlong MaskWidth, Hlong Sigma ) const

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

DescriptionπŸ”—

The operator sigma_imageSigmaImage carries out a non-linear smoothing of the gray values of all input images (Imageimageimage). 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 Sigmasigmasigma 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.

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

AttentionπŸ”—

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

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πŸ”—

Execution information
  • 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πŸ”—

Imageimageimage (input_object) (multichannel-)image(-array) β†’ object (byte / cyclic / int1 / int2 / uint2 / int4 / real)HObject (byte / cyclic / int1 / int2 / uint2 / int4 / real)HImage (byte / cyclic / int1 / int2 / uint2 / int4 / real)HObject (byte / cyclic / int1 / int2 / uint2 / int4 / real)Hobject (byte / cyclic / int1 / int2 / uint2 / int4 / real)

Image to be smoothed.

ImageSigmaimageSigmaimage_sigma (output_object) (multichannel-)image(-array) β†’ object (byte / cyclic / int1 / int2 / uint2 / int4 / real)HObject (byte / cyclic / int1 / int2 / uint2 / int4 / real)HImage (byte / cyclic / int1 / int2 / uint2 / int4 / real)HObject (byte / cyclic / int1 / int2 / uint2 / int4 / real)Hobject * (byte / cyclic / int1 / int2 / uint2 / int4 / real)

Smoothed image.

MaskHeightmaskHeightmask_height (input_control) extent.y β†’ (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Height of the mask (number of lines).

Default: 55
Suggested values: 3, 5, 7, 9, 11, 13, 153, 5, 7, 9, 11, 13, 15
Value range: 3 ≀ MaskHeight
Minimum increment: 2
Recommended increment: 2
Restriction: odd(MaskHeight)

MaskWidthmaskWidthmask_width (input_control) extent.x β†’ (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Width of the mask (number of columns).

Default: 55
Suggested values: 3, 5, 7, 9, 11, 13, 153, 5, 7, 9, 11, 13, 15
Value range: 3 ≀ MaskWidth
Minimum increment: 2
Recommended increment: 2
Restriction: odd(MaskWidth)

Sigmasigmasigma (input_control) integer β†’ (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Max. deviation to the average.

Default: 33
Suggested values: 3, 5, 7, 9, 11, 20, 30, 503, 5, 7, 9, 11, 20, 30, 50
Value range: 0 ≀ Sigma
Minimum increment: 1
Recommended increment: 2

ExampleπŸ”—

(HDevelop)

read_image(Image,'fabrik')
sigma_image(Image,ImageSigma,5,5,3)
dev_display(ImageSigma)
(C)
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_imageSigmaImage 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>). If necessary an exception is raised.

Combinations with other operatorsπŸ”—

Combinations

Possible predecessors

read_imageReadImage

Possible successors

thresholdThreshold, dyn_thresholdDynThreshold, regiongrowingRegiongrowing

Alternatives

anisotropic_diffusionAnisotropicDiffusion, rank_imageRankImage

See also

smooth_imageSmoothImage, binomial_filterBinomialFilter, gauss_filterGaussFilter, mean_imageMeanImage

ReferencesπŸ”—

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

ModuleπŸ”—

Foundation