sigma_imagesigma_imageSigmaImageSigmaImagesigma_image(算子)

名称

sigma_imagesigma_imageSigmaImageSigmaImagesigma_image — 使用西格玛滤波器进行非线性平滑。

签名

sigma_image(Image : ImageSigma : MaskHeight, MaskWidth, Sigma : )

Herror sigma_image(const Hobject Image, Hobject* ImageSigma, const Hlong MaskHeight, const Hlong MaskWidth, const Hlong Sigma)

Herror T_sigma_image(const Hobject Image, Hobject* ImageSigma, const Htuple MaskHeight, const Htuple MaskWidth, const Htuple Sigma)

void SigmaImage(const HObject& Image, HObject* ImageSigma, const HTuple& MaskHeight, const HTuple& MaskWidth, const HTuple& Sigma)

HImage HImage::SigmaImage(Hlong MaskHeight, Hlong MaskWidth, Hlong Sigma) const

static void HOperatorSet.SigmaImage(HObject image, out HObject imageSigma, HTuple maskHeight, HTuple maskWidth, HTuple sigma)

HImage HImage.SigmaImage(int maskHeight, int maskWidth, int sigma)

def sigma_image(image: HObject, mask_height: int, mask_width: int, sigma: int) -> HObject

描述

算子 sigma_imagesigma_imageSigmaImageSigmaImageSigmaImagesigma_image carries out a non-linear smoothing of the gray values of all input images (ImageImageImageImageimageimage). All pixels in a rectangular window (MaskHeight x MaskWidth) are used to determine the new gray value of the central pixel of this window. First, the gray value standard deviation of all pixels in the window is calculated. Then, all pixels of the window with a gray value that differs from the gray value of the central pixel by less than SigmaSigmaSigmaSigmasigmasigma times this standard deviation are used to calculate the new gray value of the central pixel. The gray value of the central pixel is the average of the gray values of the selected pixels. If no pixel could be selected for the averaging of the gray values, the gray value of the central pixel remains unchanged.

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

注意

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

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

执行信息

参数

ImageImageImageImageimageimage (输入对象)  (multichannel-)image(-array) objectHImageHObjectHImageHobject (byte / cyclic / int1 / int2 / uint2 / int4 / real)

待平滑的图像。

ImageSigmaImageSigmaImageSigmaImageSigmaimageSigmaimage_sigma (输出对象)  (multichannel-)image(-array) objectHImageHObjectHImageHobject * (byte / cyclic / int1 / int2 / uint2 / int4 / real)

平滑后的图像。

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

Height of the mask (number of lines).

默认值: 5

建议值: 3, 5, 7, 9, 11, 13, 15

值范围: 3 ≤ MaskHeight MaskHeight MaskHeight MaskHeight maskHeight mask_height

最小增量: 2

建议增量: 2

限制: odd(MaskHeight)

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

Width of the mask (number of columns).

默认值: 5

建议值: 3, 5, 7, 9, 11, 13, 15

值范围: 3 ≤ MaskWidth MaskWidth MaskWidth MaskWidth maskWidth mask_width

最小增量: 2

建议增量: 2

限制: odd(MaskWidth)

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

Max. deviation to the average.

默认值: 3

建议值: 3, 5, 7, 9, 11, 20, 30, 50

值范围: 0 ≤ Sigma Sigma Sigma Sigma sigma sigma

最小增量: 1

建议增量: 2

示例(HDevelop)

read_image(Image,'fabrik')
sigma_image(Image,ImageSigma,5,5,3)
dev_display(ImageSigma)

示例(C)

read_image(&Image,"fabrik");
sigma_image(Image,&ImageSigma,5,5,3);
disp_image(ImageSigma,WindowHandle);

示例(HDevelop)

read_image(Image,'fabrik')
sigma_image(Image,ImageSigma,5,5,3)
dev_display(ImageSigma)

示例(HDevelop)

read_image(Image,'fabrik')
sigma_image(Image,ImageSigma,5,5,3)
dev_display(ImageSigma)

示例(HDevelop)

read_image(Image,'fabrik')
sigma_image(Image,ImageSigma,5,5,3)
dev_display(ImageSigma)

复杂度

For each pixel: O(MaskHeight*MaskWidth).

结果

如果参数值正确,算子 sigma_imagesigma_imageSigmaImageSigmaImageSigmaImagesigma_image 返回值 2 (H_MSG_TRUE)。当输入为空(无可用输入图像)时,可设置行为通过算子 set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)。如有必要,则抛出异常。

可能的前趋

read_imageread_imageReadImageReadImageReadImageread_image

可能的后继

thresholdthresholdThresholdThresholdThresholdthreshold, dyn_thresholddyn_thresholdDynThresholdDynThresholdDynThresholddyn_threshold, regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowingregiongrowing

替代

anisotropic_diffusionanisotropic_diffusionAnisotropicDiffusionAnisotropicDiffusionAnisotropicDiffusionanisotropic_diffusion, rank_imagerank_imageRankImageRankImageRankImagerank_image

另见

smooth_imagesmooth_imageSmoothImageSmoothImageSmoothImagesmooth_image, binomial_filterbinomial_filterBinomialFilterBinomialFilterBinomialFilterbinomial_filter, gauss_filtergauss_filterGaussFilterGaussFilterGaussFiltergauss_filter, mean_imagemean_imageMeanImageMeanImageMeanImagemean_image

参考文献

R. Haralick, L. Shapiro; “Computer and Robot Vision”; Addison-Wesley, 1992, Seite 325

模块

基础