median_weightedmedian_weightedMedianWeightedMedianWeightedmedian_weighted (Operator)
Name
median_weightedmedian_weightedMedianWeightedMedianWeightedmedian_weighted
— Weighted median filtering with different rank masks.
Signature
Description
The operator median_weightedmedian_weightedMedianWeightedMedianWeightedMedianWeightedmedian_weighted
calculates the median of
the gray values within a local environment. In contrast to
median_imagemedian_imageMedianImageMedianImageMedianImagemedian_image
, which uses all gray values within the
environment exactly once, the operator median_weightedmedian_weightedMedianWeightedMedianWeightedMedianWeightedmedian_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'
(MaskSizeMaskSizeMaskSizeMaskSizemaskSizemask_size
= 3)
1 2 1
2 4 2
1 2 1
- 'inner'
(MaskSizeMaskSizeMaskSizeMaskSizemaskSizemask_size
= 3)
1 1 1
1 3 1
1 1 1
The operator median_weightedmedian_weightedMedianWeightedMedianWeightedMedianWeightedmedian_weighted
means that, contrary to
median_imagemedian_imageMedianImageMedianImageMedianImagemedian_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
ImageImageImageImageimageimage
(input_object) (multichannel-)image(-array) →
objectHImageHObjectHImageHobject (byte / int2 / uint2)
Image to be filtered.
ImageWMedianImageWMedianImageWMedianImageWMedianimageWMedianimage_wmedian
(output_object) (multichannel-)image(-array) →
objectHImageHObjectHImageHobject * (byte / int2 / uint2)
Median filtered image.
MaskTypeMaskTypeMaskTypeMaskTypemaskTypemask_type
(input_control) string →
HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Type of median mask.
Default:
'inner'
"inner"
"inner"
"inner"
"inner"
"inner"
List of values:
'gauss'"gauss""gauss""gauss""gauss""gauss", 'inner'"inner""inner""inner""inner""inner"
MaskSizeMaskSizeMaskSizeMaskSizemaskSizemask_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)
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 MaskTypeMaskTypeMaskTypeMaskTypemaskTypemask_type
.
Possible Predecessors
read_imageread_imageReadImageReadImageReadImageread_image
Possible Successors
thresholdthresholdThresholdThresholdThresholdthreshold
,
dyn_thresholddyn_thresholdDynThresholdDynThresholdDynThresholddyn_threshold
,
regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowingregiongrowing
Alternatives
median_imagemedian_imageMedianImageMedianImageMedianImagemedian_image
,
trimmed_meantrimmed_meanTrimmedMeanTrimmedMeanTrimmedMeantrimmed_mean
,
sigma_imagesigma_imageSigmaImageSigmaImageSigmaImagesigma_image
References
R. Haralick, L. Shapiro; “Computer and Robot Vision”;
Addison-Wesley, 1992, Seite 319
Module
Foundation