Skip to content

eliminate_spEliminateSpEliminateSpeliminate_speliminate_sp🔗

Short description🔗

eliminate_spEliminateSpEliminateSpeliminate_speliminate_sp — Replace values outside of thresholds with average value.

Signature🔗

eliminate_sp( image Image, out image ImageFillSP, extent.x MaskWidth, extent.y MaskHeight, integer MinThresh, integer MaxThresh )void EliminateSp( const HObject& Image, HObject* ImageFillSP, const HTuple& MaskWidth, const HTuple& MaskHeight, const HTuple& MinThresh, const HTuple& MaxThresh )static void HOperatorSet.EliminateSp( HObject image, out HObject imageFillSP, HTuple maskWidth, HTuple maskHeight, HTuple minThresh, HTuple maxThresh )def eliminate_sp( image: HObject, mask_width: int, mask_height: int, min_thresh: int, max_thresh: int ) -> HObject

Herror eliminate_sp( const Hobject Image, Hobject* ImageFillSP, const Hlong MaskWidth, const Hlong MaskHeight, const Hlong MinThresh, const Hlong MaxThresh )

Herror T_eliminate_sp( const Hobject Image, Hobject* ImageFillSP, const Htuple MaskWidth, const Htuple MaskHeight, const Htuple MinThresh, const Htuple MaxThresh )

HImage HImage::EliminateSp( Hlong MaskWidth, Hlong MaskHeight, Hlong MinThresh, Hlong MaxThresh ) const

HImage HImage.EliminateSp( int maskWidth, int maskHeight, int minThresh, int maxThresh )

Description🔗

The operator eliminate_spEliminateSp replaces all gray values outside the indicated gray value intervals (MinThreshminThreshmin_thresh to MaxThreshmaxThreshmax_thresh) with the neighboring mean values. Only those neighboring pixels which also fall within the gray value interval are used for averaging. If no such pixel is present in the vicinity the original gray value is used. The gray values in the input image falling within the gray value interval are also adopted without change.

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

Attention🔗

If even values instead of odd values are given for MaskHeightmaskHeightmask_height or MaskWidthmaskWidthmask_width, the routine uses the next larger odd values instead (this way the center of the filter mask is always explicitly determined).

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🔗

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🔗

Imageimageimage (input_object) (multichannel-)image(-array) → object (byte / uint2)HObject (byte / uint2)HImage (byte / uint2)HObject (byte / uint2)Hobject (byte / uint2)

Input image.

ImageFillSPimageFillSPimage_fill_sp (output_object) (multichannel-)image(-array) → object (byte / uint2)HObject (byte / uint2)HImage (byte / uint2)HObject (byte / uint2)Hobject * (byte / uint2)

Smoothed image.

MaskWidthmaskWidthmask_width (input_control) extent.x → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Width of filter mask.

Default: 33
Suggested values: 3, 5, 7, 9, 113, 5, 7, 9, 11
Value range: 3 ≤ MaskWidth (lin)
Minimum increment: 2
Recommended increment: 2
Restriction: odd(MaskWidth) && MaskWidth < width(Image) * 2

MaskHeightmaskHeightmask_height (input_control) extent.y → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Height of filter mask.

Default: 33
Suggested values: 3, 5, 7, 9, 113, 5, 7, 9, 11
Value range: 3 ≤ MaskHeight (lin)
Minimum increment: 2
Recommended increment: 2
Restriction: odd(MaskHeight) && MaskHeight < height(Image) * 2

MinThreshminThreshmin_thresh (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Minimum gray value.

Default: 11
Suggested values: 1, 5, 7, 9, 11, 15, 23, 31, 43, 61, 1011, 5, 7, 9, 11, 15, 23, 31, 43, 61, 101

MaxThreshmaxThreshmax_thresh (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Maximum gray value.

Default: 254254
Suggested values: 5, 7, 9, 11, 15, 23, 31, 43, 61, 101, 200, 230, 250, 2545, 7, 9, 11, 15, 23, 31, 43, 61, 101, 200, 230, 250, 254
Restriction: MinThresh <= MaxThresh

Example🔗

(HDevelop)


read_image(Image,'mreut')
dev_display(Image)
eliminate_sp(Image,ImageFillSP,3,3,101,201)
dev_display(ImageFillSP)
(C)
read_image(&Image,"mreut")\;
disp_image(Image,WindowHandle)\;
eliminate_sp(Image,&ImageFillSP,3,3,101,201)\;
disp_image(ImageFillSP,WindowHandle)\;

Combinations with other operators🔗

Combinations

Possible successors

disp_imageDispImage

Alternatives

mean_spMeanSp, mean_imageMeanImage, median_imageMedianImage, eliminate_min_maxEliminateMinMax

See also

binomial_filterBinomialFilter, gauss_filterGaussFilter, smooth_imageSmoothImage, anisotropic_diffusionAnisotropicDiffusion, sigma_imageSigmaImage, eliminate_min_maxEliminateMinMax

Module🔗

Foundation