eliminate_min_max — 在空间域中平滑图像以抑制噪声。
eliminate_min_max(Image : FilteredImage : MaskWidth, MaskHeight, Gap, Mode : )
eliminate_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). Gap controls the strictness of replacement: Only
gray values that exceed all other values within their local neighborhood
more than Gap and all values that fall below their neighboring
more than Gap 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
if , or
else if 。
Elsewise is adopted without change.
Mode specifies how to perform the new value in case of a
replacement.
Mode = 1:
replace a local maximum with next minor local maximum and
replace a local minimum with next bigger local minimum.
Mode = 2:
replace with mean value of all pixels within the local neighborhood
(including the replaced pixel).
Mode = 3:
replace with median value of all pixels within the local neighborhood
(including the replaced pixel (also used if Mode has got
any other value than 1 or 2).
MaskWidth and MaskHeight 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_max only can work on byte images (HALCON image
type BYTE_IMAGE). If MaskWidth or MaskHeight 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.
请注意,若使用域缩减后的图像作为输入,滤波器算子可能会返回意外结果。请参阅 滤波器 一章
Image (输入对象) (multichannel-)image(-array) → object (byte / uint2)
Image to smooth.
FilteredImage (输出对象) (multichannel-)image(-array) → object (byte / uint2)
平滑后的图像。
MaskWidth (输入控制) extent.x → (integer)
Width of filter mask.
默认值: 3
建议值: 3, 5, 7, 9
值范围:
3
≤
MaskWidth
≤
width(Image)
最小增量: 2
建议增量: 2
限制:
odd(MaskWidth)
MaskHeight (输入控制) extent.y → (integer)
Height of filter mask.
默认值: 3
建议值: 3, 5, 7, 9
值范围:
3
≤
MaskHeight
≤
width(Image)
最小增量: 2
建议增量: 2
限制:
odd(MaskWidth)
Gap (输入控制) number → (real)
Gap between local maximum/minimum and all other gray values of the neighborhood.
默认值: 1.0
建议值: 1.0, 2.0, 5.0, 10.0
Mode (输入控制) integer → (integer)
Replacement rule.
默认值: 3
值列表: 1, 2, 3
eliminate_min_max 在所有参数正确时返回 2 ( H_MSG_TRUE )。 如果输入为空,eliminate_min_max 返回一条错误消息。
wiener_filter,
wiener_filter_ni
mean_sp,
mean_image,
median_image,
median_weighted,
binomial_filter,
gauss_filter,
smooth_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.
基础