Herror ::median_separate (
    Hobject Image,
    Hobject *ImageSMedian,
    const HTuple &MaskWidth,
    const HTuple &MaskHeight,
    const HTuple &Margin
)
HImage HImage::MedianSeparate (
    const HTuple &MaskWidth,
    const HTuple &MaskHeight,
    const HTuple &Margin
) const
HImageArray HImageArray::MedianSeparate (
    const HTuple &MaskWidth,
    const HTuple &MaskHeight,
    const HTuple &Margin
) const

Separated median filtering with rectangle masks.

The operator ::median_separate carries out a variation of the median filtering: First two auxiliary images are created. The first one originates from a median filtering with a horizontal mask with a height of one pixel and the width MaskWidth followed by filtering with a mask with the height MaskHeight. The second auxiliary image is created by filtering with the same masks, but with a reversed sequence of the operation: first the vertical, then the horizontal mask. The output image results from averaging the two auxiliary images pixel by pixel.

The operator ::median_separate is clearly faster than the normal operator ::median_image because both masks are one pixel wide, facilitating a very effecient processing. The runtime is practically independent of the size of the mask. For example, the operator ::median_separate can be well used after texture filters, where large masks are needed.

The filter can also be used several times in a row in order to enhance the smoothing.


Parameters

Image (input_object)
(multichannel-)image(-array) -> Hobject: HImage(Array) ( byte )
Image to be filtered.

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

MaskWidth (input_control)
extent.x -> HTuple.long
Width of rank mask.
Default value: 25
Suggested values: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 27, 43, 51, 67, 91, 121, 151
Typical range of values: 1 <= MaskWidth <= 401
Minimum increment: 2
Recommended increment: 2

MaskHeight (input_control)
extent.y -> HTuple.long
Height of rank mask.
Default value: 25
Suggested values: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 27, 43, 51, 67, 91, 121, 151
Typical range of values: 1 <= MaskHeight <= 401
Minimum increment: 2
Recommended increment: 2

Margin (input_control)
integer -> HTuple.long
Margin control: 0...255 (constant), -1 (edge pixels continued), -2 (cyclic continuation), -3 (reflection).
Default value: -3
Typical range of values: -3 <= Margin <= 255
Minimum increment: 1
Recommended increment: 1


Example
read_image(&Image,"fabrik");
median_separate(Image,&MedianSeparate,5,5,3);
disp_image(MedianSeparate,WindowHandle);

Complexity

For each pixel: O(40).


Possible Predecessors

::texture_laws, ::sobel_amp, ::deviation_image


Possible Successors

::learn_ndim_norm, ::learn_ndim_box, ::median_separate, ::regiongrowing, ::auto_threshold


Alternatives

::median_image


See also

::rank_image


References

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


Module

Image filters



Copyright © 1996-2002 MVTec Software GmbH