Herror ::median_weighted (
    Hobject Image,
    Hobject *ImageWMedian,
    const HTuple &MaskType,
    const HTuple &MaskSize
)
HImage HImage::MedianWeighted (
    const HTuple &MaskType,
    const HTuple &MaskSize
) const
HImageArray HImageArray::MedianWeighted (
    const HTuple &MaskType,
    const HTuple &MaskSize
) const

Weighted median filtering with different rank masks.

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) -> Hobject: HImage(Array) ( byte / int2 )
Image to be filtered.

ImageWMedian (output_object)
(multichannel-)image(-array) -> Hobject * : HImage(Array) ( byte / int2 )
Median filtered image.

MaskType (input_control)
string -> HTuple.char *
Type of median mask.
Default value: 'inner'
List of values: 'inner', 'gauss'

MaskSize (input_control)
integer -> HTuple.long
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.


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

Image filters



Copyright © 1996-2002 MVTec Software GmbH