HALCON Reference Manual 10.0.2
Table of Contents / Filters / Smoothing ClassesClassesClasses | | | Operators

eliminate_min_maxeliminate_min_maxeliminate_min_maxEliminateMinMaxEliminateMinMax (Operator)

Name

eliminate_min_maxeliminate_min_maxeliminate_min_maxEliminateMinMaxEliminateMinMax — Smooth an image in the spatial domain to suppress noise.

Signature

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)

Herror eliminate_min_max(Hobject Image, Hobject* FilteredImage, const HTuple& MaskWidth, const HTuple& MaskHeight, const HTuple& Gap, const HTuple& Mode)

HImage HImage::EliminateMinMax(const HTuple& MaskWidth, const HTuple& MaskHeight, const HTuple& Gap, const HTuple& Mode) const

HImageArray HImageArray::EliminateMinMax(const HTuple& MaskWidth, const HTuple& MaskHeight, const HTuple& Gap, const HTuple& Mode) const

void HOperatorSetX.EliminateMinMax(
[in] IHUntypedObjectX* Image, [out] IHUntypedObjectX*FilteredImage, [in] VARIANT MaskWidth, [in] VARIANT MaskHeight, [in] VARIANT Gap, [in] VARIANT Mode)

IHImageX* HImageX.EliminateMinMax(
[in] Hlong MaskWidth, [in] Hlong MaskHeight, [in] double Gap, [in] Hlong Mode)

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)

Description

eliminate_min_maxeliminate_min_maxeliminate_min_maxEliminateMinMaxEliminateMinMax 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). GapGapGapGapgap controls the strictness of replacment: Only gray values that exceed all other values within their local neighborhood more than GapGapGapGapgap and all values that fall below their neighboring more than GapGapGapGapgap are replaced: E(x,y) represents a NxM sized rectangular neighborhood of an pixel at position (x,y), containing all pixels within the neighborhood except the pixel itself;

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

ModeModeModeModemode = 1 --> replace a local maximum with next minor local maximum and replace a local minimum with next bigger local minimum

ModeModeModeModemode = 2 --> replace with mean value of all pixels within the local neighborhood (including the replaced pixel)

ModeModeModeModemode = 3 --> replace with median value of all pixels within the local neighborhood (including the replaced pixel (this is default and used if ModeModeModeModemode has got any other value than 1 or 2)

MaskWidthMaskWidthMaskWidthMaskWidthmaskWidth and MaskHeightMaskHeightMaskHeightMaskHeightmaskHeight specifiy the width and height of the rectangular neighborhood. Border treatment: Pixels outside the image border are not considered (e.g.: With a local 3x3-mask the neighborhood of a pixel at (0,0) reduces to the pixels at (1,0),(0,1) and (1,1)).

Attention

eliminate_min_maxeliminate_min_maxeliminate_min_maxEliminateMinMaxEliminateMinMax only can work on byte images (HALCON image type BYTE_IMAGE). If MaskWidthMaskWidthMaskWidthMaskWidthmaskWidth or MaskHeightMaskHeightMaskHeightMaskHeightmaskHeight 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.

Parallelization

Parameters

ImageImageImageImageimage (input_object)  (multichannel-)image(-array) objectHImageHImageHImageXHobject (byte / uint2)

Image to smooth.

FilteredImageFilteredImageFilteredImageFilteredImagefilteredImage (output_object)  (multichannel-)image(-array) objectHImageHImageHImageXHobject * (byte / uint2)

Smoothed image.

MaskWidthMaskWidthMaskWidthMaskWidthmaskWidth (input_control)  extent.x HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Width of filter mask.

Default value: 3

Suggested values: 3, 5, 7, 9

Typical range of values: 3 ≤ MaskWidth MaskWidth MaskWidth MaskWidth maskWidth ≤ width(Image)

Minimum increment: 2

Recommended increment: 2

Restriction: odd(MaskWidth)

MaskHeightMaskHeightMaskHeightMaskHeightmaskHeight (input_control)  extent.y HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Height of filter mask.

Default value: 3

Suggested values: 3, 5, 7, 9

Typical range of values: 3 ≤ MaskHeight MaskHeight MaskHeight MaskHeight maskHeight ≤ width(Image)

Minimum increment: 2

Recommended increment: 2

Restriction: odd(MaskWidth)

GapGapGapGapgap (input_control)  number HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

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

Default value: 1.0

Suggested values: 1.0, 2.0, 5.0, 10.0

ModeModeModeModemode (input_control)  integer HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Replacement rule (1 = next minimum/maximum, 2 = average, 3 =median).

Default value: 3

List of values: 1, 2, 3

Result

eliminate_min_maxeliminate_min_maxeliminate_min_maxEliminateMinMaxEliminateMinMax returns 2 (H_MSG_TRUE) if all parameters are correct. If the input is empty eliminate_min_maxeliminate_min_maxeliminate_min_maxEliminateMinMaxEliminateMinMax returns with an error message.

Possible Successors

wiener_filterwiener_filterwiener_filterWienerFilterWienerFilter, wiener_filter_niwiener_filter_niwiener_filter_niWienerFilterNiWienerFilterNi

See also

mean_spmean_spmean_spMeanSpMeanSp, mean_imagemean_imagemean_imageMeanImageMeanImage, median_imagemedian_imagemedian_imageMedianImageMedianImage, median_weightedmedian_weightedmedian_weightedMedianWeightedMedianWeighted, binomial_filterbinomial_filterbinomial_filterBinomialFilterBinomialFilter, gauss_imagegauss_imagegauss_imageGaussImageGaussImage, smooth_imagesmooth_imagesmooth_imageSmoothImageSmoothImage

References

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.

Module

Foundation


Table of Contents / Filters / Smoothing ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH