Non-linear smoothing with the sigma filter.
The operator sigma__ 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.
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).
Image (input_object) |
image(-array) -> object : byte / int1 / int2 / int4 / real |
Image to be smoothed. |
ImageSigma (output_object) |
image(-array) -> object : byte / int1 / int2 / int4 / real |
Smoothed image. |
MaskHeight (input_control) |
extent.y -> integer |
Height of the mask (number of lines). | |
Default value: 5 | |
Suggested values: 3, 5, 7, 9, 11, 13, 15 | |
Range of values: 3 <= MaskHeight <= 101 | |
Minimum increment: 2 | |
Recommended increment: 2 | |
Restriction: odd(MaskHeight) |
MaskWidth (input_control) |
extent.x -> integer |
Width of the mask (number of columns). | |
Default value: 5 | |
Suggested values: 3, 5, 7, 9, 11, 13, 15 | |
Range of values: 3 <= MaskWidth <= 101 | |
Minimum increment: 2 | |
Recommended increment: 2 | |
Restriction: odd(MaskWidth) |
Sigma (input_control) |
integer -> integer |
Max. deviation to the average. | |
Default value: 3 | |
Suggested values: 3, 5, 7, 9, 11, 20, 30, 50 | |
Range of values: 0 <= Sigma <= 255 | |
Minimum increment: 1 | |
Recommended increment: 2 |
read_image(:Image:'fabrik':) > sigma__(Image:ImageSigma:5,5,3:) > disp_image(ImageSigma:::).
For each pixel: O(MaskHeight*MaskWidth)
If the parameter values are correct the operator sigma__ returns the value 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.
threshold__, dyn_threshold__, regiongrowing__
R. Haralick, L. Shapiro; "Computer and Robot Vision"; Addison-Wesley, 1992, Seite 325