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

Non-linear smoothing with the sigma filter.

The operator ::sigma_image carries out a non-linear smoothing of the gray values of all input images (Image). All pixels are checked in a rectangular window (MaskHeight x MaskWidth). All pixels of the window which differ from the current pixel by less than Sigma are used for calculating the new pixel, which is the average of the chosen pixels. If all differences are larger than Sigma the gray value is adapted unchanged.


Attention

The filter is implemented for images of the 'byte' type only. If even values instead of odd values are given for MaskHeight or MaskWidth, the routine uses the next larger odd values instead (this way the center of the filter mask is always explicitly determined).


Parameters

Image (input_object)
(multichannel-)image(-array) -> Hobject: HImage(Array) ( byte / int1 / int2 / int4 / real )
Image to be smoothed.

ImageSigma (output_object)
(multichannel-)image(-array) -> Hobject * : HImage(Array) ( byte / int1 / int2 / int4 / real )
Smoothed image.

MaskHeight (input_control)
extent.y -> HTuple.long
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 <= 101
Minimum increment: 2
Recommended increment: 2
Restriction: odd(MaskHeight)

MaskWidth (input_control)
extent.x -> HTuple.long
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 <= 101
Minimum increment: 2
Recommended increment: 2
Restriction: odd(MaskWidth)

Sigma (input_control)
integer -> HTuple.long
Max. deviation to the average.
Default value: 3
Suggested values: 3, 5, 7, 9, 11, 20, 30, 50
Typical range of values: 0 <= Sigma <= 255
Minimum increment: 1
Recommended increment: 2


Example
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_image returns the value 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 handling is raised.


Possible Predecessors

::read_image


Possible Successors

::threshold, ::dyn_threshold, ::regiongrowing


Alternatives

::anisotrope_diff, ::rank_image


See also

::smooth_image, ::gauss_image, ::mean_image


References

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


Module

Image filters



Copyright © 1996-2002 MVTec Software GmbH