ClassesClasses | | Operators

median_weightedmedian_weightedMedianWeightedMedianWeighted (Operator)

Name

median_weightedmedian_weightedMedianWeightedMedianWeighted — Weighted median filtering with different rank masks.

Signature

median_weighted(Image : ImageWMedian : MaskType, MaskSize : )

Herror median_weighted(const Hobject Image, Hobject* ImageWMedian, const char* MaskType, const Hlong MaskSize)

Herror T_median_weighted(const Hobject Image, Hobject* ImageWMedian, const Htuple MaskType, const Htuple MaskSize)

void MedianWeighted(const HObject& Image, HObject* ImageWMedian, const HTuple& MaskType, const HTuple& MaskSize)

HImage HImage::MedianWeighted(const HString& MaskType, Hlong MaskSize) const

HImage HImage::MedianWeighted(const char* MaskType, Hlong MaskSize) const

static void HOperatorSet.MedianWeighted(HObject image, out HObject imageWMedian, HTuple maskType, HTuple maskSize)

HImage HImage.MedianWeighted(string maskType, int maskSize)

Description

The operator median_weightedmedian_weightedMedianWeightedMedianWeightedMedianWeighted calculates the median of the gray values within a local environment. In contrast to median_imagemedian_imageMedianImageMedianImageMedianImage, which uses all gray values within the environment exactly once, the operator median_weightedmedian_weightedMedianWeightedMedianWeightedMedianWeighted 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'

(MaskSizeMaskSizeMaskSizeMaskSizemaskSize = 3)

1 2 1
2 4 2
1 2 1

'inner'

(MaskSizeMaskSizeMaskSizeMaskSizemaskSize = 3)

1 1 1
1 3 1
1 1 1

The operator median_weightedmedian_weightedMedianWeightedMedianWeightedMedianWeighted means that, contrary to median_imagemedian_imageMedianImageMedianImageMedianImage, gray value corners remain.

For an explanation of the concept of smoothing filters see the introduction of chapter Filters / Smoothing.

Attention

Note that filter operators may return unexpected results if an image with a reduced domain is used as input. Please refer to the chapter Filters.

Execution Information

Parameters

ImageImageImageImageimage (input_object)  (multichannel-)image(-array) objectHImageHImageHobject (byte / int2 / uint2)

Image to be filtered.

ImageWMedianImageWMedianImageWMedianImageWMedianimageWMedian (output_object)  (multichannel-)image(-array) objectHImageHImageHobject * (byte / int2 / uint2)

Median filtered image.

MaskTypeMaskTypeMaskTypeMaskTypemaskType (input_control)  string HTupleHTupleHtuple (string) (string) (HString) (char*)

Type of median mask.

Default value: 'inner' "inner" "inner" "inner" "inner"

List of values: 'gauss'"gauss""gauss""gauss""gauss", 'inner'"inner""inner""inner""inner"

MaskSizeMaskSizeMaskSizeMaskSizemaskSize (input_control)  integer HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

mask size.

Default value: 3

List of values: 3

Example (HDevelop)

read_image(Image,'fabrik')
median_weighted(Image,MedianWeighted,'gauss',3)
dev_display(MedianWeighted)

Example (C)

read_image(&Image,"fabrik");
median_weighted(Image,&MedianWeighted,"gauss",3);
disp_image(MedianWeighted,WindowHandle);

Example (HDevelop)

read_image(Image,'fabrik')
median_weighted(Image,MedianWeighted,'gauss',3)
dev_display(MedianWeighted)

Example (HDevelop)

read_image(Image,'fabrik')
median_weighted(Image,MedianWeighted,'gauss',3)
dev_display(MedianWeighted)

Example (HDevelop)

read_image(Image,'fabrik')
median_weighted(Image,MedianWeighted,'gauss',3)
dev_display(MedianWeighted)

Complexity

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

Possible Predecessors

read_imageread_imageReadImageReadImageReadImage

Possible Successors

thresholdthresholdThresholdThresholdThreshold, dyn_thresholddyn_thresholdDynThresholdDynThresholdDynThreshold, regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowing

Alternatives

median_imagemedian_imageMedianImageMedianImageMedianImage, trimmed_meantrimmed_meanTrimmedMeanTrimmedMeanTrimmedMean, sigma_imagesigma_imageSigmaImageSigmaImageSigmaImage

References

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

Module

Foundation


ClassesClasses | | Operators