mean_image_shapemean_image_shapeMeanImageShapeMeanImageShapemean_image_shape (算子)
名称
mean_image_shapemean_image_shapeMeanImageShapeMeanImageShapemean_image_shape — 使用具有任意掩模的均值滤波器平滑图像。
签名
def mean_image_shape(image: HObject, mask: HObject) -> HObject
描述
mean_image_shapemean_image_shapeMeanImageShapeMeanImageShapeMeanImageShapemean_image_shape performs a mean filter operation on the input image
ImageImageImageImageimageimage with a mask that is specified by the region
MaskMaskMaskMaskmaskmask and returns the filtered image in ImageMeanImageMeanImageMeanImageMeanimageMeanimage_mean.
The shape of the mask can be chosen arbitrarily and can, for
example, be created with operators like gen_circlegen_circleGenCircleGenCircleGenCirclegen_circle or
draw_regiondraw_regionDrawRegionDrawRegionDrawRegiondraw_region。The position of the mask does not influence
the result since the center of gravity of the mask region is used as
the reference point of the mask. For border treatment the gray values are
reflected at the image edges.
For mean_image_shapemean_image_shapeMeanImageShapeMeanImageShapeMeanImageShapemean_image_shape special optimizations are implemented that use SIMD
technology. The actual application of these special optimizations is
controlled by the system parameter 'avx2_enable'"avx2_enable""avx2_enable""avx2_enable""avx2_enable""avx2_enable"
(see set_systemset_systemSetSystemSetSystemSetSystemset_system).
If 'avx2_enable'"avx2_enable""avx2_enable""avx2_enable""avx2_enable""avx2_enable" is set to 'true'"true""true""true""true""true" (and the SIMD
instruction set is available), the internal calculations are performed
using SIMD technology. Furthermore, these optimizations are only used
for byte images and if the area of the filter mask provided by
MaskMaskMaskMaskmaskmask is smaller than 129.
Note that mean_image_shapemean_image_shapeMeanImageShapeMeanImageShapeMeanImageShapemean_image_shape performs best on compact input regions.
At any rate, it is advantageous for the performance of mean_image_shapemean_image_shapeMeanImageShapeMeanImageShapeMeanImageShapemean_image_shape
to choose the input region of ImageImageImageImageimageimage such that any border treatment
is avoided.
有关平滑滤波器概念的说明,请参阅 滤波器 / 平滑 一章的引言。
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 在元组级别上自动并行化。
- 在通道级别上自动并行化。
- 在内部数据级别上自动并行化。
参数
ImageImageImageImageimageimage (输入对象) (multichannel-)image(-array) → objectHImageHObjectHImageHobject (byte / uint2 / real)
Image to be filtered.
MaskMaskMaskMaskmaskmask (输入对象) region → objectHRegionHObjectHRegionHobject
Filter mask.
ImageMeanImageMeanImageMeanImageMeanimageMeanimage_mean (输出对象) (multichannel-)image(-array) → objectHImageHObjectHImageHobject * (byte / uint2 / real)
滤波后的图像。
示例(HDevelop)
read_image (Image, 'fabrik')
gen_circle (Circle, 10, 10, 2)
mean_image_shape (Image, Circle, ImageMean)
dev_display (ImageMean)
结果
如果参数值正确,算子 mean_image_shapemean_image_shapeMeanImageShapeMeanImageShapeMeanImageShapemean_image_shape 返回值 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,
reduce_domainreduce_domainReduceDomainReduceDomainReduceDomainreduce_domain,
rectangle1_domainrectangle1_domainRectangle1DomainRectangle1DomainRectangle1Domainrectangle1_domain,
gen_circlegen_circleGenCircleGenCircleGenCirclegen_circle
可能的后继
dyn_thresholddyn_thresholdDynThresholdDynThresholdDynThresholddyn_threshold,
regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowingregiongrowing
替代
binomial_filterbinomial_filterBinomialFilterBinomialFilterBinomialFilterbinomial_filter,
gauss_filtergauss_filterGaussFilterGaussFilterGaussFiltergauss_filter,
smooth_imagesmooth_imageSmoothImageSmoothImageSmoothImagesmooth_image,
mean_imagemean_imageMeanImageMeanImageMeanImagemean_image
另见
anisotropic_diffusionanisotropic_diffusionAnisotropicDiffusionAnisotropicDiffusionAnisotropicDiffusionanisotropic_diffusion,
sigma_imagesigma_imageSigmaImageSigmaImageSigmaImagesigma_image,
convol_imageconvol_imageConvolImageConvolImageConvolImageconvol_image,
gen_lowpassgen_lowpassGenLowpassGenLowpassGenLowpassgen_lowpass
模块
基础