eliminate_min_maxeliminate_min_maxEliminateMinMaxEliminateMinMaxeliminate_min_max (算子)

名称

eliminate_min_maxeliminate_min_maxEliminateMinMaxEliminateMinMaxeliminate_min_max — 在空间域中平滑图像以抑制噪声。

签名

eliminate_min_max(Image : FilteredImage : MaskWidth, MaskHeight, Gap, Mode : )

Herror eliminate_min_max(const Hobject Image, Hobject* FilteredImage, const Hlong MaskWidth, const Hlong MaskHeight, double Gap, const Hlong Mode)

Herror T_eliminate_min_max(const Hobject Image, Hobject* FilteredImage, const Htuple MaskWidth, const Htuple MaskHeight, const Htuple Gap, const Htuple Mode)

void EliminateMinMax(const HObject& Image, HObject* FilteredImage, const HTuple& MaskWidth, const HTuple& MaskHeight, const HTuple& Gap, const HTuple& Mode)

HImage HImage::EliminateMinMax(Hlong MaskWidth, Hlong MaskHeight, double Gap, Hlong Mode) const

static void HOperatorSet.EliminateMinMax(HObject image, out HObject filteredImage, HTuple maskWidth, HTuple maskHeight, HTuple gap, HTuple mode)

HImage HImage.EliminateMinMax(int maskWidth, int maskHeight, double gap, int mode)

def eliminate_min_max(image: HObject, mask_width: int, mask_height: int, gap: float, mode: int) -> HObject

描述

eliminate_min_maxeliminate_min_maxEliminateMinMaxEliminateMinMaxEliminateMinMaxeliminate_min_max smooths an image by replacing gray values with neighboring mean values, or local minima/maxima. In order to prevent edges and lines from being smoothed, only those gray values that represent local minima or maxima are replaced (if there is a line or edge within an image there will be at least one neighboring pixel with a comparable gray value). GapGapGapGapgapgap controls the strictness of replacement: Only gray values that exceed all other values within their local neighborhood more than GapGapGapGapgapgap and all values that fall below their neighboring more than GapGapGapGapgapgap are replaced.

Thus, with being the gray value at position and representing the gray values of a sized rectangular neighborhood of a pixel at position , containing all pixels within the neighborhood except the pixel itself, a pixel is replaced

ModeModeModeModemodemode specifies how to perform the new value in case of a replacement.

MaskWidthMaskWidthMaskWidthMaskWidthmaskWidthmask_width and MaskHeightMaskHeightMaskHeightMaskHeightmaskHeightmask_height specify the width and height of the rectangular neighborhood. Border treatment: Pixels outside the image border are not considered (e.g., with a local -mask the neighborhood of a pixel at reduces to the pixels at , , and ).

有关平滑滤波器概念的说明,请参阅 滤波器 / 平滑 一章的引言。

注意

eliminate_min_maxeliminate_min_maxEliminateMinMaxEliminateMinMaxEliminateMinMaxeliminate_min_max only can work on byte images (HALCON image type BYTE_IMAGE). If MaskWidthMaskWidthMaskWidthMaskWidthmaskWidthmask_width or MaskHeightMaskHeightMaskHeightMaskHeightmaskHeightmask_height is an even number, it is replaced by the next higher odd number (this allows the unique extraction of the center of the filter mask). Width/height of the mask may not exceed the image width/height.

请注意,若使用域缩减后的图像作为输入,滤波器算子可能会返回意外结果。请参阅 滤波器 一章

执行信息

参数

ImageImageImageImageimageimage (输入对象)  (multichannel-)image(-array) objectHImageHObjectHImageHobject (byte / uint2)

Image to smooth.

FilteredImageFilteredImageFilteredImageFilteredImagefilteredImagefiltered_image (输出对象)  (multichannel-)image(-array) objectHImageHObjectHImageHobject * (byte / uint2)

平滑后的图像。

MaskWidthMaskWidthMaskWidthMaskWidthmaskWidthmask_width (输入控制)  extent.x HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Width of filter mask.

默认值: 3

建议值: 3, 5, 7, 9

值范围: 3 ≤ MaskWidth MaskWidth MaskWidth MaskWidth maskWidth mask_width ≤ width(Image)

最小增量: 2

建议增量: 2

限制: odd(MaskWidth)

MaskHeightMaskHeightMaskHeightMaskHeightmaskHeightmask_height (输入控制)  extent.y HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Height of filter mask.

默认值: 3

建议值: 3, 5, 7, 9

值范围: 3 ≤ MaskHeight MaskHeight MaskHeight MaskHeight maskHeight mask_height ≤ width(Image)

最小增量: 2

建议增量: 2

限制: odd(MaskWidth)

GapGapGapGapgapgap (输入控制)  number HTuplefloatHTupleHtuple (real) (double) (double) (double)

Gap between local maximum/minimum and all other gray values of the neighborhood.

默认值: 1.0

建议值: 1.0, 2.0, 5.0, 10.0

ModeModeModeModemodemode (输入控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Replacement rule.

默认值: 3

值列表: 1, 2, 3

结果

eliminate_min_maxeliminate_min_maxEliminateMinMaxEliminateMinMaxEliminateMinMaxeliminate_min_max 在所有参数正确时返回 2 ( H_MSG_TRUE )。 如果输入为空,eliminate_min_maxeliminate_min_maxEliminateMinMaxEliminateMinMaxEliminateMinMaxeliminate_min_max 返回一条错误消息。

可能的后继

wiener_filterwiener_filterWienerFilterWienerFilterWienerFilterwiener_filter, wiener_filter_niwiener_filter_niWienerFilterNiWienerFilterNiWienerFilterNiwiener_filter_ni

另见

mean_spmean_spMeanSpMeanSpMeanSpmean_sp, mean_imagemean_imageMeanImageMeanImageMeanImagemean_image, median_imagemedian_imageMedianImageMedianImageMedianImagemedian_image, median_weightedmedian_weightedMedianWeightedMedianWeightedMedianWeightedmedian_weighted, binomial_filterbinomial_filterBinomialFilterBinomialFilterBinomialFilterbinomial_filter, gauss_filtergauss_filterGaussFilterGaussFilterGaussFiltergauss_filter, smooth_imagesmooth_imageSmoothImageSmoothImageSmoothImagesmooth_image

参考文献

M. Imme:“A Noise Peak Elimination Filter”; S. 204-211 in CVGIP Graphical Models and Image Processing, Vol. 53, No. 2, March 1991
M. Lückenhaus:“Grundlagen des Wiener-Filters und seine Anwendung in der Bildanalyse”; Diplomarbeit; Technische Universität München, Institut für Informatik; Lehrstuhl Prof. Radig; 1995.

模块

基础