Operator Reference

gray_closing_rectgray_closing_rectGrayClosingRectGrayClosingRectgray_closing_rect (Operator)

gray_closing_rectgray_closing_rectGrayClosingRectGrayClosingRectgray_closing_rect — Perform a gray value closing with a rectangular mask.

Signature

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

Description

gray_closing_rectgray_closing_rectGrayClosingRectGrayClosingRectgray_closing_rect applies a gray value closing to the input image ImageImageImageimageimage with a rectangular mask of size (MaskHeightMaskHeightMaskHeightmaskHeightmask_height, MaskWidthMaskWidthMaskWidthmaskWidthmask_width). The resulting image is returned in ImageClosingImageClosingImageClosingimageClosingimage_closing. If the parameters MaskHeightMaskHeightMaskHeightmaskHeightmask_height or MaskWidthMaskWidthMaskWidthmaskWidthmask_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_rectGrayDilationRectGrayDilationRectgray_dilation_rect and gray_erosion_rectgray_erosion_rectGrayErosionRectGrayErosionRectgray_erosion_rect).

Attention

Note that filter operators may return unexpected results if an image with a reduced domain is used as input. Please refer to the chapter Filters.

Execution Information

  • Supports OpenCL compute devices.
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).
  • Multithreading scope: global (may be called from any thread).
  • Automatically parallelized on tuple level.
  • Automatically parallelized on channel level.
  • Automatically parallelized on domain level.

Parameters

ImageImageImageimageimage (input_object)  (multichannel-)image(-array) objectHImageHObjectHObjectHobject (byte / direction / cyclic / uint2 / int2 / int4 / real)

Input image.

ImageClosingImageClosingImageClosingimageClosingimage_closing (output_object)  (multichannel-)image(-array) objectHImageHObjectHObjectHobject * (byte / direction / cyclic / uint2 / int2 / int4 / real)

Gray-closed image.

MaskHeightMaskHeightMaskHeightmaskHeightmask_height (input_control)  extent.y HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Height of the filter mask.

Default: 11

Suggested values: 3, 5, 7, 9, 11, 13, 15

Value range: 3 ≤ MaskHeight MaskHeight MaskHeight maskHeight mask_height ≤ 511

Minimum increment: 2

Recommended increment: 2

Restriction: odd(MaskHeight) && MaskHeight < height(Image) * 2

MaskWidthMaskWidthMaskWidthmaskWidthmask_width (input_control)  extent.x HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Width of the filter mask.

Default: 11

Suggested values: 3, 5, 7, 9, 11, 13, 15

Value range: 3 ≤ MaskWidth MaskWidth MaskWidth maskWidth mask_width ≤ 511

Minimum increment: 2

Recommended increment: 2

Restriction: odd(MaskWidth) && MaskWidth < width(Image) * 2

Result

gray_closing_rectgray_closing_rectGrayClosingRectGrayClosingRectgray_closing_rect returns 2 ( H_MSG_TRUE) if all parameters are correct. If the input is empty the behavior can be set via set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>). If necessary, an exception is raised.

Alternatives

gray_closinggray_closingGrayClosingGrayClosinggray_closing, gray_closing_shapegray_closing_shapeGrayClosingShapeGrayClosingShapegray_closing_shape

See also

closing_rectangle1closing_rectangle1ClosingRectangle1ClosingRectangle1closing_rectangle1, gray_dilation_rectgray_dilation_rectGrayDilationRectGrayDilationRectgray_dilation_rect, gray_erosion_rectgray_erosion_rectGrayErosionRectGrayErosionRectgray_erosion_rect

Module

Foundation