HALCON Reference Manual / Filter / Smoothing Operators

midrange_image (Operator)

Name

midrange_image — Calculate the average of maximum and minimum inside any mask.

Synopsis

midrange_image(Image, Mask : ImageMidrange : Margin : )

Description

The operator midrange_image forms the average of maximum and minimum inside the indicated mask in the whole image. Several border treatments (Margin) can be chosen for filtering:

    gray value   Pixels outside of the image edges
                 are assumed to be constant (with the
                 indicated gray value).
    'continued'  Continuation of edge pixels.
    'cyclic'     Cyclic continuation of image edges.
    'mirrored'   Reflection of pixels at the image edges.

The indicated mask (= region of the mask image) is put over the image to be filtered in such a way that the center of the mask touches all pixels once.

Parameters

Image (input_object) (multichannel-)image(-array) object (byte / int2 / uint2 / int4 / real)
Image to be filtered.

Mask (input_object) region object (byte)
Region serving as filter mask.

ImageMidrange (output_object) (multichannel-)image(-array) object (byte / int2 / uint2 / int4 / real)
Filtered output image.

Margin (input_control) string (string / integer / real)
Border treatment.
Default value: 'mirrored'
Suggested values: 'mirrored', 'cyclic', 'continued', 0, 30, 60, 90, 120, 150, 180, 210, 240, 255

Example

read_image(Image,'fabrik')
draw_region(Region,WindowHandle)
midrange_image(Image,Region,Midrange,'mirrored')
disp_image(Midrange,WindowHandle)

Complexity

For each pixel: O(sqrt(F) * 5) with F = area of Mask.

Result

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

Parallelization Information

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

Possible Predecessors

read_image, draw_region, gen_circle, gen_rectangle1

Possible Successors

threshold, dyn_threshold, regiongrowing

Alternatives

sigma_image

See also

gen_circle, gen_rectangle1, gray_erosion_rect, gray_dilation_rect, gray_range_rect

References

R. Haralick, L. Shapiro; “Computer and Robot Vision”; Addison-Wesley, 1992, Seite 319

Module

Foundation


HALCON Reference Manual / Filter / Smoothing Operators
Version 9.0.2 Copyright © 1996-2010 MVTec Software GmbH