smooth_imagesmooth_imageSmoothImageSmoothImagesmooth_image (算子)

名称

smooth_imagesmooth_imageSmoothImageSmoothImagesmooth_image — 使用各种滤波器平滑图像。

签名

smooth_image(Image : ImageSmooth : Filter, Alpha : )

Herror smooth_image(const Hobject Image, Hobject* ImageSmooth, const char* Filter, double Alpha)

Herror T_smooth_image(const Hobject Image, Hobject* ImageSmooth, const Htuple Filter, const Htuple Alpha)

void SmoothImage(const HObject& Image, HObject* ImageSmooth, const HTuple& Filter, const HTuple& Alpha)

HImage HImage::SmoothImage(const HString& Filter, double Alpha) const

HImage HImage::SmoothImage(const char* Filter, double Alpha) const

HImage HImage::SmoothImage(const wchar_t* Filter, double Alpha) const   ( Windows only)

static void HOperatorSet.SmoothImage(HObject image, out HObject imageSmooth, HTuple filter, HTuple alpha)

HImage HImage.SmoothImage(string filter, double alpha)

def smooth_image(image: HObject, filter: str, alpha: float) -> HObject

描述

smooth_imagesmooth_imageSmoothImageSmoothImageSmoothImagesmooth_image smooths gray images using recursive filters originally developed by Deriche and Shen and using the non-recursive Gaussian filter. The following filters can be chosen via the parameter FilterFilterFilterFilterfilterfilter: 'deriche1', 'deriche2', 'shen' and 'gauss'. The “filter width” (i.e., the range of the filter and thereby result of the filter) can be of any size. In the case that the Deriche or Shen is chosen it decreases by increasing the filter parameter AlphaAlphaAlphaAlphaalphaalpha and increases in the case of the Gauss filter (and AlphaAlphaAlphaAlphaalphaalpha corresponds to the standard deviation of the Gaussian function). An approximation of the appropriate size of the filter width AlphaAlphaAlphaAlphaalphaalpha is performed by the operator info_smoothinfo_smoothInfoSmoothInfoSmoothInfoSmoothinfo_smooth

Non-recursive filters like the Gaussian filter are often implemented using filter-masks. In this case the runtime of the operator increases with increasing size of the filter mask. The runtime of the recursive filters remains constant; except the border treatment becomes a little bit more time consuming. The Gaussian filter becomes slow in comparison to the recursive ones but is in contrast to them isotropic (the filter 'deriche2' is only weakly direction sensitive). A comparable result of the smoothing is achieved by choosing the following values for the parameter: Alpha(deriche2) = Alpha(deriche1) / 2, Alpha(shen) = Alpha(deriche1) / 2, Alpha(gauss) = 1.77 / Alpha(deriche1).

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

注意

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

执行信息

参数

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

待平滑的图像。

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

平滑后的图像。

FilterFilterFilterFilterfilterfilter (输入控制)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Filter.

默认值: 'deriche2' "deriche2" "deriche2" "deriche2" "deriche2" "deriche2"

值列表: 'deriche1'"deriche1""deriche1""deriche1""deriche1""deriche1", 'deriche2'"deriche2""deriche2""deriche2""deriche2""deriche2", 'gauss'"gauss""gauss""gauss""gauss""gauss", 'shen'"shen""shen""shen""shen""shen"

AlphaAlphaAlphaAlphaalphaalpha (输入控制)  real HTuplefloatHTupleHtuple (real) (double) (double) (double)

Filter parameter: small values cause strong smoothing (vice versa by using 'gauss'"gauss""gauss""gauss""gauss""gauss").

默认值: 0.5

建议值: 0.1, 0.2, 0.3, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0, 7.0, 10.0

最小增量: 0.01

建议增量: 0.1

限制: Alpha > 0

示例(HDevelop)

info_smooth('deriche2',0.5,Size,Coeffs)
smooth_image(Input,Smooth,'deriche2',7)

示例(C)

info_smooth('deriche2',0.5,Size,Coeffs);
smooth_image(Input,&Smooth,'deriche2',7);

示例(HDevelop)

info_smooth('deriche2',0.5,Size,Coeffs)
smooth_image(Input,Smooth,'deriche2',7)

示例(HDevelop)

info_smooth('deriche2',0.5,Size,Coeffs)
smooth_image(Input,Smooth,'deriche2',7)

示例(HDevelop)

info_smooth('deriche2',0.5,Size,Coeffs)
smooth_image(Input,Smooth,'deriche2',7)

结果

如果参数值正确,算子 smooth_imagesmooth_imageSmoothImageSmoothImageSmoothImagesmooth_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

替代

binomial_filterbinomial_filterBinomialFilterBinomialFilterBinomialFilterbinomial_filter, gauss_filtergauss_filterGaussFilterGaussFilterGaussFiltergauss_filter, mean_imagemean_imageMeanImageMeanImageMeanImagemean_image, derivate_gaussderivate_gaussDerivateGaussDerivateGaussDerivateGaussderivate_gauss, isotropic_diffusionisotropic_diffusionIsotropicDiffusionIsotropicDiffusionIsotropicDiffusionisotropic_diffusion

另见

info_smoothinfo_smoothInfoSmoothInfoSmoothInfoSmoothinfo_smooth, median_imagemedian_imageMedianImageMedianImageMedianImagemedian_image, sigma_imagesigma_imageSigmaImageSigmaImageSigmaImagesigma_image, anisotropic_diffusionanisotropic_diffusionAnisotropicDiffusionAnisotropicDiffusionAnisotropicDiffusionanisotropic_diffusion

参考文献

R.Deriche: “Fast Algorithms for Low-Level Vision”; IEEE Transactions on Pattern Analysis and Machine Intelligence; PAMI-12, no. 1; S. 78-87; 1990.

模块

基础