mean_image_shape
— Smooth image using a mean filter with arbitrary mask.
mean_image_shape
performs a mean filter operation on the input image
Image
with a mask that is specified by the region
Mask
and returns the filtered image in ImageMean
.
The shape of the mask can be chosen arbitrarily and can, for
example, be created with operators like gen_circle
or
draw_region
. The position of the mask does not influence
the result since the center of gravity of the mask region is used as
the reference point of the mask. For border treatment the gray values are
reflected at the image edges.
For mean_image_shape
special optimizations are implemented that use SIMD
technology. The actual application of these special optimizations is
controlled by the system parameter 'avx2_enable'
(see set_system
).
If 'avx2_enable' is set to 'true' (and the SIMD
instruction set is available), the internal calculations are performed
using SIMD technology. Furthermore, these optimizations are only used
for byte images and if the area of the filter mask provided by
Mask
is smaller than 129.
Note that mean_image_shape
performs best on compact input regions.
At any rate, it is advantageous for the performance of mean_image_shape
to choose the input region of Image
such that any border treatment
is avoided.
For an explanation of the concept of smoothing filters see the introduction of chapter Filters / Smoothing.
Image
(input_object) (multichannel-)image(-array) →
object (byte / uint2 / real)
Image to be filtered.
Mask
(input_object) region →
object
Filter mask.
ImageMean
(output_object) (multichannel-)image(-array) →
object (byte / uint2 / real)
Filtered image.
read_image (Image, 'fabrik') gen_circle (Circle, 10, 10, 2) mean_image_shape (Image, Circle, ImageMean) dev_display (ImageMean)
If the parameter values are correct the operator mean_image_shape
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 is raised.
read_image
,
reduce_domain
,
rectangle1_domain
,
gen_circle
binomial_filter
,
gauss_filter
,
smooth_image
,
mean_image
anisotropic_diffusion
,
sigma_image
,
convol_image
,
gen_lowpass
Foundation