mean_image ( Image : ImageMean : MaskWidth, MaskHeight : )

Smooth by averaging.

The operator mean_image 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 border treatment 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)
(multichannel-)image(-array) -> object : byte / int2 / uint2 / int4 / real / dvf
Image to be smoothed.

ImageMean (output_object)
(multichannel-)image(-array) -> object : byte / int2 / uint2 / int4 / real / dvf
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
Typical range of values: 1 <= 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
Typical range of values: 1 <= MaskHeight <= 501
Minimum increment: 2
Recommended increment: 2
Restriction: odd(MaskHeight)


Example
read_image(Image,'fabrik') 
mean_image(Image,Mean,3,3)  
disp_image(Mean,WindowHandle).

Complexity

For each pixel: O(15).


Result

If the parameter values are correct the operator mean_image 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 handling is raised.


Parallelization Information

mean_image is reentrant and automatically parallelized (on tuple level, channel level, domain level).


Possible Successors

dyn_threshold, regiongrowing


Alternatives

gauss_image, smooth_image


See also

anisotrope_diff, sigma_image, convol_image, gen_lowpass


Module

Image filters



Copyright © 1996-2005 MVTec Software GmbH