Skip to content

gray_closing_rectGrayClosingRectGrayClosingRectgray_closing_rectgray_closing_rect🔗

Short description🔗

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

Signature🔗

gray_closing_rect( image Image, out image ImageClosing, extent.y MaskHeight, extent.x MaskWidth )void GrayClosingRect( const HObject& Image, HObject* ImageClosing, const HTuple& MaskHeight, const HTuple& MaskWidth )static void HOperatorSet.GrayClosingRect( HObject image, out HObject imageClosing, HTuple maskHeight, HTuple maskWidth )def gray_closing_rect( image: HObject, mask_height: int, mask_width: int ) -> HObject

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 )

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

HImage HImage.GrayClosingRect( int maskHeight, int maskWidth )

Description🔗

gray_closing_rectGrayClosingRect applies a gray value closing to the input image Imageimageimage with a rectangular mask of size (MaskHeightmaskHeightmask_height, MaskWidthmaskWidthmask_width). The resulting image is returned in ImageClosingimageClosingimage_closing. If the parameters MaskHeightmaskHeightmask_height or MaskWidthmaskWidthmask_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

\[\begin{eqnarray*} i \circ s = (i \oplus s) \ominus s \enspace , \end{eqnarray*}\]

i.e., a dilation of the image with \(s\) followed by an erosion with \(s\) (see gray_dilation_rectGrayDilationRect and gray_erosion_rectGrayErosionRect).

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🔗

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🔗

Imageimageimage (input_object) (multichannel-)image(-array) → object (byte / direction / cyclic / uint2 / int2 / int4 / real)HObject (byte / direction / cyclic / uint2 / int2 / int4 / real)HImage (byte / direction / cyclic / uint2 / int2 / int4 / real)HObject (byte / direction / cyclic / uint2 / int2 / int4 / real)Hobject (byte / direction / cyclic / uint2 / int2 / int4 / real)

Input image.

ImageClosingimageClosingimage_closing (output_object) (multichannel-)image(-array) → object (byte / direction / cyclic / uint2 / int2 / int4 / real)HObject (byte / direction / cyclic / uint2 / int2 / int4 / real)HImage (byte / direction / cyclic / uint2 / int2 / int4 / real)HObject (byte / direction / cyclic / uint2 / int2 / int4 / real)Hobject * (byte / direction / cyclic / uint2 / int2 / int4 / real)

Gray-closed image.

MaskHeightmaskHeightmask_height (input_control) extent.y → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Height of the filter mask.

Default: 1111
Suggested values: 3, 5, 7, 9, 11, 13, 153, 5, 7, 9, 11, 13, 15
Value range: 3 ≤ MaskHeight ≤ 511
Minimum increment: 2
Recommended increment: 2
Restriction: odd(MaskHeight) && MaskHeight < height(Image) * 2

MaskWidthmaskWidthmask_width (input_control) extent.x → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Width of the filter mask.

Default: 1111
Suggested values: 3, 5, 7, 9, 11, 13, 153, 5, 7, 9, 11, 13, 15
Value range: 3 ≤ MaskWidth ≤ 511
Minimum increment: 2
Recommended increment: 2
Restriction: odd(MaskWidth) && MaskWidth < width(Image) * 2

Result🔗

gray_closing_rectGrayClosingRect 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>). If necessary, an exception is raised.

Combinations with other operators🔗

Combinations

Alternatives

gray_closingGrayClosing, gray_closing_shapeGrayClosingShape

See also

closing_rectangle1ClosingRectangle1, gray_dilation_rectGrayDilationRect, gray_erosion_rectGrayErosionRect

Module🔗

Foundation