mean__ ( Image : ImageMean : MaskWidth, MaskHeight : )

Smooth by averaging.

The operator mean__ carries out a linear smoothing with the gray values of all input images (Image). The filter matrix consists of ones (evaluated equally) and has the size MaskHeight x MaskWidth. The result of the convolution is divided by MaskHeight x MaskWidth . For margin control the gray values are reflected at the image edges.


Attention

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)
image(-array) -> object : byte / int4 / real
Image to be smoothed.

ImageMean (output_object)
image(-array) -> object : byte / int4 / real
Smoothed image.

MaskWidth (input_control)
extent.x -> integer
Width of filter mask.
Default value: 9
Suggested values: 3, 5, 7, 9, 11, 15, 23, 31, 43, 61, 101
Range of values: 3 <= MaskWidth <= 501
Minimum increment: 2
Recommended increment: 2
Restriction: odd(MaskWidth)

MaskHeight (input_control)
extent.y -> integer
Height of filter mask.
Default value: 9
Suggested values: 3, 5, 7, 9, 11, 15, 23, 31, 43, 61, 101
Range of values: 3 <= MaskHeight <= 501
Minimum increment: 2
Recommended increment: 2
Restriction: odd(MaskHeight)


Example
read_image(:Image:'fabrik':) >
mean__(Image:Mean:3,3:) > 
disp_image(Mean:::).

Complexity

For each pixel: O(15).


Result

If the parameter values are correct the operator mean__ 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.


Possible Successors

dyn_threshold__, regiongrowing__


Alternatives

gauss__, smooth__


See also

anisotrope_diff__, sigma__, convol__, gen_lowpass



Copyright © 1996-1997 MVTec Software GmbH