DIPlib Documentation - ©1995-2011 Quantitative Imaging Group, Delft University of Technology.

Sigma

Adaptive uniform smoothing filter

SYNOPSIS

#include "dip_filtering.h"

dip_Error dip_Sigma ( in, out, se, boundary, param, shape, sigma, outputCount )

DATA TYPES

integer, float

FUNCTION

The Sigma filter is an adaptive Uniform smoothing filter. The value of the pixel underinvestigation is replaced by the average of the pixelvalues in the filter region (as specified by param, shape and se) which lie in the interval +/- 2 sigma from the value of the pixel that is filtered. If outputCount is DIP_TRUE, the output values represent the number of pixels over which the average has been calculated. When threshold is DIP_TRUE, the pixel intensities are thresholded at +/- 2 sigma, when it is set to DIP_FALSE, the intensities are weighted with the Gaussian difference with the intensity of the center pixel.

Only the rectangular, elliptic and diamond filter shapes are supported (DIP_FLT_SHAPE_RECTANGULAR, DIP_FLT_SHAPE_ELLIPTIC and DIP_FLT_SHAPE_DIAMOND). Other filter shapes can be implemented by setting shape to DIP_FLT_SHAPE_STRUCTURING_ELEMENT, and passing a binary image in se. The "on" pixels define the shape of the filter window. Other values of shape are illegal.

If shape is not equal to DIP_FLT_SHAPE_STRUCTURING_ELEMENT, se can be set to zero. When shape is set to DIP_FLT_SHAPE_STRUCTURING_ELEMENT, param is ignored, and can be set to zero.

ARGUMENTS

Data typeNameDescription
dip_ImageinInput image
dip_ImageoutOutput image
dip_ImageseCustom filter window (binary)
dip_BoundaryArrayboundaryBoundary conditions
dip_FloatArrayparamFilter sizes
dip_FilterShapeshapeFilter shape
dip_floatsigmaSigma
dip_BooleanoutputCountOutput the Count

The enumerator dip_FilterShape contains the following constants:

NameDescription
DIP_FLT_SHAPE_DEFAULTDefault filter window, same as DIP_FLT_SHAPE_RECTANGULAR
DIP_FLT_SHAPE_RECTANGULARRectangular filter window, can be even in size
DIP_FLT_SHAPE_ELLIPTICElliptic filter window, always odd in size
DIP_FLT_SHAPE_DIAMONDDiamond-shaped filter window, always odd in size
DIP_FLT_SHAPE_PARABOLICParabolic filter window (morphology only)
DIP_FLT_SHAPE_DISCRETE_LINERotated line structuring element (morphology only)
DIP_FLT_SHAPE_INTERPOLATED_LINERotated line structuring element, through interpolation (morphology only)
DIP_FLT_SHAPE_PERIODIC_LINE(not implemented)
DIP_FLT_SHAPE_STRUCTURING_ELEMENTUse se as filter window, can be any size

LITERATURE

John-Sen Lee, Digital Image Smoothing and the Sigma Filter, Computer Vision, Graphics and Image Processing, 24, 255-269, 1983

SEE ALSO

BiasedSigma, GaussianSigma, Uniform