gray_closing_rectgray_closing_rectGrayClosingRectGrayClosingRectgray_closing_rect (算子)

名称

gray_closing_rectgray_closing_rectGrayClosingRectGrayClosingRectgray_closing_rect — 使用矩形掩模执行灰度值闭。

签名

gray_closing_rect(Image : ImageClosing : MaskHeight, MaskWidth : )

Herror gray_closing_rect(const Hobject Image, Hobject* ImageClosing, const Hlong MaskHeight, const Hlong MaskWidth)

Herror T_gray_closing_rect(const Hobject Image, Hobject* ImageClosing, const Htuple MaskHeight, const Htuple MaskWidth)

void GrayClosingRect(const HObject& Image, HObject* ImageClosing, const HTuple& MaskHeight, const HTuple& MaskWidth)

HImage HImage::GrayClosingRect(Hlong MaskHeight, Hlong MaskWidth) const

static void HOperatorSet.GrayClosingRect(HObject image, out HObject imageClosing, HTuple maskHeight, HTuple maskWidth)

HImage HImage.GrayClosingRect(int maskHeight, int maskWidth)

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

描述

gray_closing_rectgray_closing_rectGrayClosingRectGrayClosingRectGrayClosingRectgray_closing_rect applies a gray value closing to the input image ImageImageImageImageimageimage with a rectangular mask of size (MaskHeightMaskHeightMaskHeightMaskHeightmaskHeightmask_height, MaskWidthMaskWidthMaskWidthMaskWidthmaskWidthmask_width). The resulting image is returned in ImageClosingImageClosingImageClosingImageClosingimageClosingimage_closing. If the parameters MaskHeightMaskHeightMaskHeightMaskHeightmaskHeightmask_height or MaskWidthMaskWidthMaskWidthMaskWidthmaskWidthmask_width are even, they are changed to the next larger odd value. At the border of the image the gray values are mirrored.

The gray value closing of an image i with a rectangular structuring element s is defined as i.e., a dilation of the image with s followed by an erosion with s (see gray_dilation_rectgray_dilation_rectGrayDilationRectGrayDilationRectGrayDilationRectgray_dilation_rect and gray_erosion_rectgray_erosion_rectGrayErosionRectGrayErosionRectGrayErosionRectgray_erosion_rect).

注意

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

执行信息

参数

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

输入图像。

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

Gray-closed image.

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

Height of the filter mask.

默认值: 11

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

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

最小增量: 2

建议增量: 2

限制: odd(MaskHeight) && MaskHeight < height(Image) * 2

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

Width of the filter mask.

默认值: 11

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

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

最小增量: 2

建议增量: 2

限制: odd(MaskWidth) && MaskWidth < width(Image) * 2

结果

gray_closing_rectgray_closing_rectGrayClosingRectGrayClosingRectGrayClosingRectgray_closing_rect 在所有参数正确时返回 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>)。如有必要,则抛出异常。

替代

gray_closinggray_closingGrayClosingGrayClosingGrayClosinggray_closing, gray_closing_shapegray_closing_shapeGrayClosingShapeGrayClosingShapeGrayClosingShapegray_closing_shape

另见

closing_rectangle1closing_rectangle1ClosingRectangle1ClosingRectangle1ClosingRectangle1closing_rectangle1, gray_dilation_rectgray_dilation_rectGrayDilationRectGrayDilationRectGrayDilationRectgray_dilation_rect, gray_erosion_rectgray_erosion_rectGrayErosionRectGrayErosionRectGrayErosionRectgray_erosion_rect

模块

基础