HALCON Reference Manual 10.0.2
Table of Contents / Filters / Smoothing ClassesClassesClasses | | | Operators

median_separatemedian_separatemedian_separateMedianSeparateMedianSeparate (Operator)

Name

median_separatemedian_separatemedian_separateMedianSeparateMedianSeparate — Separated median filtering with rectangle masks.

Signature

median_separate(Image : ImageSMedian : MaskWidth, MaskHeight, Margin : )

Herror median_separate(const Hobject Image, Hobject* ImageSMedian, const Hlong MaskWidth, const Hlong MaskHeight, const char* Margin)

Herror T_median_separate(const Hobject Image, Hobject* ImageSMedian, const Htuple MaskWidth, const Htuple MaskHeight, const Htuple Margin)

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

void HOperatorSetX.MedianSeparate(
[in] IHUntypedObjectX* Image, [out] IHUntypedObjectX*ImageSMedian, [in] VARIANT MaskWidth, [in] VARIANT MaskHeight, [in] VARIANT Margin)

IHImageX* HImageX.MedianSeparate(
[in] Hlong MaskWidth, [in] Hlong MaskHeight, [in] VARIANT Margin)

static void HOperatorSet.MedianSeparate(HObject image, out HObject imageSMedian, HTuple maskWidth, HTuple maskHeight, HTuple margin)

HImage HImage.MedianSeparate(int maskWidth, int maskHeight, HTuple margin)

HImage HImage.MedianSeparate(int maskWidth, int maskHeight, string margin)

Description

The operator median_separatemedian_separatemedian_separateMedianSeparateMedianSeparate 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 MaskWidthMaskWidthMaskWidthMaskWidthmaskWidth followed by filtering with a mask with the height MaskHeightMaskHeightMaskHeightMaskHeightmaskHeight. 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_separatemedian_separatemedian_separateMedianSeparateMedianSeparate is clearly faster than the normal operator median_imagemedian_imagemedian_imageMedianImageMedianImage 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_separatemedian_separatemedian_separateMedianSeparateMedianSeparate 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.

Parallelization

Parameters

ImageImageImageImageimage (input_object)  (multichannel-)image(-array) objectHImageHImageHImageXHobject (byte / int2 / uint2 / int4 / real)

Image to be filtered.

ImageSMedianImageSMedianImageSMedianImageSMedianimageSMedian (output_object)  (multichannel-)image(-array) objectHImageHImageHImageXHobject * (byte / int2 / uint2 / int4 / real)

Median filtered image.

MaskWidthMaskWidthMaskWidthMaskWidthmaskWidth (input_control)  extent.x HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

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 MaskWidth MaskWidth MaskWidth maskWidth ≤ 401

Minimum increment: 2

Recommended increment: 2

MaskHeightMaskHeightMaskHeightMaskHeightmaskHeight (input_control)  extent.y HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

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 MaskHeight MaskHeight MaskHeight maskHeight ≤ 401

Minimum increment: 2

Recommended increment: 2

MarginMarginMarginMarginmargin (input_control)  string HTupleHTupleVARIANTHtuple (string / integer / real) (string / int / long / double) (char* / Hlong / double) (BSTR / Hlong / double) (char* / Hlong / double)

Border treatment.

Default value: 'mirrored' "mirrored" "mirrored" "mirrored" "mirrored"

Suggested values: 'mirrored'"mirrored""mirrored""mirrored""mirrored", 'cyclic'"cyclic""cyclic""cyclic""cyclic", 'continued'"continued""continued""continued""continued", 0, 30, 60, 90, 120, 150, 180, 210, 240, 255

Example (HDevelop)

read_image(Image,'fabrik')
median_separate(Image,MedianSeparate,5,5,3)
disp_image(MedianSeparate,WindowHandle)

Example (C)

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

Example (HDevelop)

read_image(Image,'fabrik')
median_separate(Image,MedianSeparate,5,5,3)
disp_image(MedianSeparate,WindowHandle)

Example (HDevelop)

read_image(Image,'fabrik')
median_separate(Image,MedianSeparate,5,5,3)
disp_image(MedianSeparate,WindowHandle)

Example (HDevelop)

read_image(Image,'fabrik')
median_separate(Image,MedianSeparate,5,5,3)
disp_image(MedianSeparate,WindowHandle)

Complexity

For each pixel: O(40).

Possible Predecessors

texture_lawstexture_lawstexture_lawsTextureLawsTextureLaws, sobel_ampsobel_ampsobel_ampSobelAmpSobelAmp, deviation_imagedeviation_imagedeviation_imageDeviationImageDeviationImage

Possible Successors

learn_ndim_normlearn_ndim_normlearn_ndim_normLearnNdimNormLearnNdimNorm, learn_ndim_boxlearn_ndim_boxlearn_ndim_boxLearnNdimBoxLearnNdimBox, median_separatemedian_separatemedian_separateMedianSeparateMedianSeparate, regiongrowingregiongrowingregiongrowingRegiongrowingRegiongrowing, auto_thresholdauto_thresholdauto_thresholdAutoThresholdAutoThreshold

Alternatives

median_imagemedian_imagemedian_imageMedianImageMedianImage

See also

rank_imagerank_imagerank_imageRankImageRankImage

References

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

Module

Foundation


Table of Contents / Filters / Smoothing ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH