HALCON Reference Manual / Filter / Smoothing Operators

median_weighted (Operator)

Name

median_weighted — Weighted median filtering with different rank masks.

Synopsis

median_weighted(Image : ImageWMedian : MaskType, MaskSize : )

Description

The operator median_weighted calculates the median of the gray values within a local environment. In contrast to median_image, which uses all gray values within the environment exactly once, the operator median_weighted weights all gray values several times depending on their position. A gray value is received into the field to be sorted several times according to its weighting. The following masks are available:

'gauss' at MaskSize = 3

1 2 1 
2 4 2
1 2 1

'inner' at MaskSize = 3

1 1 1
1 3 1
1 1 1

The operator median_weighted means that, contrary to median_image, gray value corners remain.

Parameters

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

ImageWMedian (output_object) (multichannel-)image(-array) object (byte / int2)
Median filtered image.

MaskType (input_control) string (string)
Type of median mask.
Default value: 'inner'
List of values: 'inner', 'gauss'

MaskSize (input_control) integer (integer)
mask size.
Default value: 3
List of values: 3

Example

read_image(Image,'fabrik')
median_weighted(Image,MedianWeighted,'gauss',3)
disp_image(MedianWeighted,WindowHandle)

Complexity

For each pixel: O(F * log(F)) with F = area of MaskType.

Parallelization Information

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

Possible Predecessors

read_image

Possible Successors

threshold, dyn_threshold, regiongrowing

Alternatives

median_image, trimmed_mean, sigma_image

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