ClassesClassesClassesClasses | | | | Operators

mean_spmean_spMeanSpmean_spMeanSpMeanSp (Operator)

Name

mean_spmean_spMeanSpmean_spMeanSpMeanSp — Suppress salt and pepper noise.

Signature

mean_sp(Image : ImageSPMean : MaskWidth, MaskHeight, MinThresh, MaxThresh : )

Herror mean_sp(const Hobject Image, Hobject* ImageSPMean, const Hlong MaskWidth, const Hlong MaskHeight, const Hlong MinThresh, const Hlong MaxThresh)

Herror T_mean_sp(const Hobject Image, Hobject* ImageSPMean, const Htuple MaskWidth, const Htuple MaskHeight, const Htuple MinThresh, const Htuple MaxThresh)

Herror mean_sp(Hobject Image, Hobject* ImageSPMean, const HTuple& MaskWidth, const HTuple& MaskHeight, const HTuple& MinThresh, const HTuple& MaxThresh)

HImage HImage::MeanSp(const HTuple& MaskWidth, const HTuple& MaskHeight, const HTuple& MinThresh, const HTuple& MaxThresh) const

HImageArray HImageArray::MeanSp(const HTuple& MaskWidth, const HTuple& MaskHeight, const HTuple& MinThresh, const HTuple& MaxThresh) const

void MeanSp(const HObject& Image, HObject* ImageSPMean, const HTuple& MaskWidth, const HTuple& MaskHeight, const HTuple& MinThresh, const HTuple& MaxThresh)

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

void HOperatorSetX.MeanSp(
[in] IHUntypedObjectX* Image, [out] IHUntypedObjectX*ImageSPMean, [in] VARIANT MaskWidth, [in] VARIANT MaskHeight, [in] VARIANT MinThresh, [in] VARIANT MaxThresh)

IHImageX* HImageX.MeanSp(
[in] Hlong MaskWidth, [in] Hlong MaskHeight, [in] Hlong MinThresh, [in] Hlong MaxThresh)

static void HOperatorSet.MeanSp(HObject image, out HObject imageSPMean, HTuple maskWidth, HTuple maskHeight, HTuple minThresh, HTuple maxThresh)

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

Description

The operator mean_spmean_spMeanSpmean_spMeanSpMeanSp carries out a smoothing by averaging the values. Only the gray values within the interval from MinThreshMinThreshMinThreshMinThreshMinThreshminThresh to MaxThreshMaxThreshMaxThreshMaxThreshMaxThreshmaxThresh are averaged. Gray values which are too light or too dark are ignored during summation. If no gray value lies within the default interval during summation the original gray value is adopted. If the thresholds are set at 0 or 255, respectively, the operator mean_spmean_spMeanSpmean_spMeanSpMeanSp behaves like mean_imagemean_imageMeanImagemean_imageMeanImageMeanImage except for the running time.

The operator mean_spmean_spMeanSpmean_spMeanSpMeanSp is used to suppress extreme gray values (salt and pepper noise = white and black dots).

Attention

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

Parallelization

Parameters

ImageImageImageImageImageimage (input_object)  (multichannel-)image(-array) objectHImageHImageHImageHImageXHobject (byte / uint2)

Input image.

ImageSPMeanImageSPMeanImageSPMeanImageSPMeanImageSPMeanimageSPMean (output_object)  (multichannel-)image(-array) objectHImageHImageHImageHImageXHobject * (byte / uint2)

Smoothed image.

MaskWidthMaskWidthMaskWidthMaskWidthMaskWidthmaskWidth (input_control)  extent.x HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Width of filter mask.

Default value: 3

Suggested values: 3, 5, 7, 9, 11

Typical range of values: 3 ≤ MaskWidth MaskWidth MaskWidth MaskWidth MaskWidth maskWidth ≤ 512 (lin)

Minimum increment: 2

Recommended increment: 2

Restriction: odd(MaskWidth)

MaskHeightMaskHeightMaskHeightMaskHeightMaskHeightmaskHeight (input_control)  extent.y HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Height of filter mask.

Default value: 3

Suggested values: 3, 5, 7, 9, 11

Typical range of values: 3 ≤ MaskHeight MaskHeight MaskHeight MaskHeight MaskHeight maskHeight ≤ 512 (lin)

Minimum increment: 2

Recommended increment: 2

Restriction: odd(MaskHeight)

MinThreshMinThreshMinThreshMinThreshMinThreshminThresh (input_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Minimum gray value.

Default value: 1

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

MaxThreshMaxThreshMaxThreshMaxThreshMaxThreshmaxThresh (input_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Maximum gray value.

Default value: 254

Suggested values: 5, 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)
mean_sp(Image,ImageMeansp,3,3,101,201)
dev_display(ImageMeansp)

Example (C)

read_image(&Image,"mreut");
disp_image(Image,WindowHandle);
mean_sp(Image,&ImageMeansp,3,3,101,201);
disp_image(ImageMeansp,WindowHandle);

Example (HDevelop)

read_image(Image,'mreut')
dev_display(Image)
mean_sp(Image,ImageMeansp,3,3,101,201)
dev_display(ImageMeansp)

Example (HDevelop)

read_image(Image,'mreut')
dev_display(Image)
mean_sp(Image,ImageMeansp,3,3,101,201)
dev_display(ImageMeansp)

Example (HDevelop)

read_image(Image,'mreut')
dev_display(Image)
mean_sp(Image,ImageMeansp,3,3,101,201)
dev_display(ImageMeansp)

Example (HDevelop)

read_image(Image,'mreut')
dev_display(Image)
mean_sp(Image,ImageMeansp,3,3,101,201)
dev_display(ImageMeansp)

Possible Successors

disp_imagedisp_imageDispImagedisp_imageDispImageDispImage

Alternatives

mean_imagemean_imageMeanImagemean_imageMeanImageMeanImage, median_imagemedian_imageMedianImagemedian_imageMedianImageMedianImage, median_separatemedian_separateMedianSeparatemedian_separateMedianSeparateMedianSeparate, eliminate_min_maxeliminate_min_maxEliminateMinMaxeliminate_min_maxEliminateMinMaxEliminateMinMax

See also

anisotropic_diffusionanisotropic_diffusionAnisotropicDiffusionanisotropic_diffusionAnisotropicDiffusionAnisotropicDiffusion, sigma_imagesigma_imageSigmaImagesigma_imageSigmaImageSigmaImage, binomial_filterbinomial_filterBinomialFilterbinomial_filterBinomialFilterBinomialFilter, gauss_filtergauss_filterGaussFiltergauss_filterGaussFilterGaussFilter, smooth_imagesmooth_imageSmoothImagesmooth_imageSmoothImageSmoothImage, eliminate_min_maxeliminate_min_maxEliminateMinMaxeliminate_min_maxEliminateMinMaxEliminateMinMax

Module

Foundation


ClassesClassesClassesClasses | | | | Operators