equ_histo_image_rectequ_histo_image_rectEquHistoImageRectEquHistoImageRectequ_histo_image_rect (算子)
名称
equ_histo_image_rectequ_histo_image_rectEquHistoImageRectEquHistoImageRectequ_histo_image_rect — 矩形掩模内的直方图线性化。
签名
Herror equ_histo_image_rect(const Hobject Image, Hobject* ImageEquHisto, const char* Mode, const Hlong MaskWidth, const Hlong MaskHeight, double MaxContrast)
Herror T_equ_histo_image_rect(const Hobject Image, Hobject* ImageEquHisto, const Htuple Mode, const Htuple MaskWidth, const Htuple MaskHeight, const Htuple MaxContrast)
void EquHistoImageRect(const HObject& Image, HObject* ImageEquHisto, const HTuple& Mode, const HTuple& MaskWidth, const HTuple& MaskHeight, const HTuple& MaxContrast)
HImage HImage::EquHistoImageRect(const HString& Mode, Hlong MaskWidth, Hlong MaskHeight, const HTuple& MaxContrast) const
HImage HImage::EquHistoImageRect(const HString& Mode, Hlong MaskWidth, Hlong MaskHeight, double MaxContrast) const
HImage HImage::EquHistoImageRect(const char* Mode, Hlong MaskWidth, Hlong MaskHeight, double MaxContrast) const
HImage HImage::EquHistoImageRect(const wchar_t* Mode, Hlong MaskWidth, Hlong MaskHeight, double MaxContrast) const
(
Windows only)
static void HOperatorSet.EquHistoImageRect(HObject image, out HObject imageEquHisto, HTuple mode, HTuple maskWidth, HTuple maskHeight, HTuple maxContrast)
HImage HImage.EquHistoImageRect(string mode, int maskWidth, int maskHeight, HTuple maxContrast)
HImage HImage.EquHistoImageRect(string mode, int maskWidth, int maskHeight, double maxContrast)
描述
算子 equ_histo_image_rectequ_histo_image_rectEquHistoImageRectEquHistoImageRectEquHistoImageRectequ_histo_image_rect enhances the contrast.
Similar to equ_histo_imageequ_histo_imageEquHistoImageEquHistoImageEquHistoImageequ_histo_image, it applies a transformation to linearize
the cumulative histogram. However, instead of using the histogram of the
whole image, only the local neighborhood of each pixel is considered to
compute the transformation. The size of this rectangular neighborhood region
can be set by MaskWidthMaskWidthMaskWidthMaskWidthmaskWidthmask_width and MaskHeightMaskHeightMaskHeightMaskHeightmaskHeightmask_height。
The local contrast maximization improves the visibility of low-contrast
structures, but also amplifies noise. The parameter MaxContrastMaxContrastMaxContrastMaxContrastmaxContrastmax_contrast can
be used to limit the maximum contrast in a local neighborhood, which
effectively reduces the amplification of noise. Therefore, the method is also
known as Contrast-Limited Adaptive Histogram Equalization (CLAHE).
The parameter ModeModeModeModemodemode determines the processing mode.
In the 'accurate'"accurate""accurate""accurate""accurate""accurate" mode, the transformation is computed for each
pixel as described above.
In the 'fast'"fast""fast""fast""fast""fast" mode, the transformation is computed only for a subset
of all pixels and interpolated between those points.
Due to the interpolation, the results of both modes can differ significantly.
注意
算子 equ_histo_image_rectequ_histo_image_rectEquHistoImageRectEquHistoImageRectEquHistoImageRectequ_histo_image_rect primarily serves for
optical processing of images for a human viewer. For example, the
contrast spreading can lead to a detection of fictitious edges.
请注意,若使用域缩减后的图像作为输入,滤波器算子可能会返回意外结果。请参阅 滤波器 一章
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 在元组级别上自动并行化。
- 在通道级别上自动并行化。
- 在域级别上自动并行化。
参数
ImageImageImageImageimageimage (输入对象) (multichannel-)image(-array) → objectHImageHObjectHImageHobject (byte)
Image to be enhanced.
ImageEquHistoImageEquHistoImageEquHistoImageEquHistoimageEquHistoimage_equ_histo (输出对象) (multichannel-)image(-array) → objectHImageHObjectHImageHobject * (byte)
Image with linearized gray values.
ModeModeModeModemodemode (输入控制) string → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Processing mode.
默认值:
'accurate'
"accurate"
"accurate"
"accurate"
"accurate"
"accurate"
建议值:
'accurate'"accurate""accurate""accurate""accurate""accurate", 'fast'"fast""fast""fast""fast""fast"
MaskWidthMaskWidthMaskWidthMaskWidthmaskWidthmask_width (输入控制) extent.x → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Width of the filter mask.
默认值:
51
建议值:
31, 51, 101, 151
值范围:
1
≤
MaskWidth
MaskWidth
MaskWidth
MaskWidth
maskWidth
mask_width
最小增量:
2
限制:
MaskWidth <= width(Image)
MaskHeightMaskHeightMaskHeightMaskHeightmaskHeightmask_height (输入控制) extent.y → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Height of the filter mask.
默认值:
51
建议值:
31, 51, 101, 151
值范围:
1
≤
MaskHeight
MaskHeight
MaskHeight
MaskHeight
maskHeight
mask_height
最小增量:
2
限制:
MaskHeight <= height(Image)
MaxContrastMaxContrastMaxContrastMaxContrastmaxContrastmax_contrast (输入控制) real → HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Maximum contrast.
默认值:
0.01
建议值:
0, 0.01, 0.02, 0.05, 0.1, 0.5, 1
值范围:
0
≤
MaxContrast
MaxContrast
MaxContrast
MaxContrast
maxContrast
max_contrast
≤
1
复杂度
In ModeModeModeModemodemode='accurate'"accurate""accurate""accurate""accurate""accurate", equ_histo_image_rectequ_histo_image_rectEquHistoImageRectEquHistoImageRectEquHistoImageRectequ_histo_image_rect uses an
algorithm with constant complexity per pixel, i.e., the runtime only depends
on the size of the input image and not on the mask size.
In ModeModeModeModemodemode='fast'"fast""fast""fast""fast""fast", the number of histograms to be computed
depends on the mask size. Hence, the runtime increases with smaller mask
sizes and decreases with larger mask sizes.
可能的后继
disp_imagedisp_imageDispImageDispImageDispImagedisp_image
替代
equ_histo_imageequ_histo_imageEquHistoImageEquHistoImageEquHistoImageequ_histo_image,
scale_imagescale_imageScaleImageScaleImageScaleImagescale_image,
scale_image_maxscale_image_maxScaleImageMaxScaleImageMaxScaleImageMaxscale_image_max,
illuminateilluminateIlluminateIlluminateIlluminateilluminate
另见
equ_histo_imageequ_histo_imageEquHistoImageEquHistoImageEquHistoImageequ_histo_image,
scale_imagescale_imageScaleImageScaleImageScaleImagescale_image
参考文献
S. Pizer et al.: “Adaptive Histogram Equalization and Its Variations”.
Computer Vision, Graphics, and Image Processing 39, pp. 355-368, 1987.
模块
基础