median_weightedmedian_weightedMedianWeightedMedianWeightedmedian_weighted (Operator)
Name
median_weightedmedian_weightedMedianWeightedMedianWeightedmedian_weighted
— Weighted median filtering with different rank masks.
Signature
Description
The operator median_weightedmedian_weightedMedianWeightedMedianWeightedmedian_weighted
calculates the median of
the gray values within a local environment. In contrast to
median_imagemedian_imageMedianImageMedianImagemedian_image
, which uses all gray values within the
environment exactly once, the operator median_weightedmedian_weightedMedianWeightedMedianWeightedmedian_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'
(MaskSizeMaskSizeMaskSizemaskSizemask_size
= 3)
1 2 1
2 4 2
1 2 1
- 'inner'
(MaskSizeMaskSizeMaskSizemaskSizemask_size
= 3)
1 1 1
1 3 1
1 1 1
The operator median_weightedmedian_weightedMedianWeightedMedianWeightedmedian_weighted
means that, contrary to
median_imagemedian_imageMedianImageMedianImagemedian_image
, 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
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Automatically parallelized on tuple level.
- Automatically parallelized on channel level.
- Automatically parallelized on domain level.
Parameters
ImageImageImageimageimage
(input_object) (multichannel-)image(-array) →
objectHImageHObjectHObjectHobject (byte / int2 / uint2)
Image to be filtered.
ImageWMedianImageWMedianImageWMedianimageWMedianimage_wmedian
(output_object) (multichannel-)image(-array) →
objectHImageHObjectHObjectHobject * (byte / int2 / uint2)
Median filtered image.
MaskTypeMaskTypeMaskTypemaskTypemask_type
(input_control) string →
HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Type of median mask.
Default:
'inner'
"inner"
"inner"
"inner"
"inner"
List of values:
'gauss'"gauss""gauss""gauss""gauss", 'inner'"inner""inner""inner""inner"
MaskSizeMaskSizeMaskSizemaskSizemask_size
(input_control) integer →
HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
mask size.
Default:
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)
Complexity
For each pixel: O(F * log(F)) with F = area of MaskTypeMaskTypeMaskTypemaskTypemask_type
.
Possible Predecessors
read_imageread_imageReadImageReadImageread_image
Possible Successors
thresholdthresholdThresholdThresholdthreshold
,
dyn_thresholddyn_thresholdDynThresholdDynThresholddyn_threshold
,
regiongrowingregiongrowingRegiongrowingRegiongrowingregiongrowing
Alternatives
median_imagemedian_imageMedianImageMedianImagemedian_image
,
trimmed_meantrimmed_meanTrimmedMeanTrimmedMeantrimmed_mean
,
sigma_imagesigma_imageSigmaImageSigmaImagesigma_image
References
R. Haralick, L. Shapiro; “Computer and Robot Vision”;
Addison-Wesley, 1992, Seite 319
Module
Foundation