Skip to content

gray_dilation_shapeGrayDilationShapeGrayDilationShapegray_dilation_shapegray_dilation_shapeπŸ”—

Short descriptionπŸ”—

gray_dilation_shapeGrayDilationShapeGrayDilationShapegray_dilation_shapegray_dilation_shape β€” Determine the maximum gray value within a selected mask.

SignatureπŸ”—

gray_dilation_shape( image Image, out image ImageMax, extent.y MaskHeight, extent.x MaskWidth, string MaskShape )void GrayDilationShape( const HObject& Image, HObject* ImageMax, const HTuple& MaskHeight, const HTuple& MaskWidth, const HTuple& MaskShape )static void HOperatorSet.GrayDilationShape( HObject image, out HObject imageMax, HTuple maskHeight, HTuple maskWidth, HTuple maskShape )def gray_dilation_shape( image: HObject, mask_height: Union[int, float], mask_width: Union[int, float], mask_shape: str ) -> HObject

Herror gray_dilation_shape( const Hobject Image, Hobject* ImageMax, double MaskHeight, double MaskWidth, const char* MaskShape )

Herror T_gray_dilation_shape( const Hobject Image, Hobject* ImageMax, const Htuple MaskHeight, const Htuple MaskWidth, const Htuple MaskShape )

HImage HImage::GrayDilationShape( const HTuple& MaskHeight, const HTuple& MaskWidth, const HString& MaskShape ) const

HImage HImage::GrayDilationShape( double MaskHeight, double MaskWidth, const HString& MaskShape ) const

HImage HImage::GrayDilationShape( double MaskHeight, double MaskWidth, const char* MaskShape ) const

HImage HImage::GrayDilationShape( double MaskHeight, double MaskWidth, const wchar_t* MaskShape ) const (Windows only)

HImage HImage.GrayDilationShape( HTuple maskHeight, HTuple maskWidth, string maskShape )

HImage HImage.GrayDilationShape( double maskHeight, double maskWidth, string maskShape )

DescriptionπŸ”—

gray_dilation_shapeGrayDilationShape calculates the maximum gray value of the input image Imageimageimage within a mask of shape MaskShapemaskShapemask_shape, vertical size MaskHeightmaskHeightmask_height and horizontal size MaskWidthmaskWidthmask_width for each image point. The resulting image is returned in ImageMaximageMaximage_max.

If the parameters MaskHeightmaskHeightmask_height or MaskWidthmaskWidthmask_width are of the type integer and are even, they are changed to the next larger odd value. In contrast, if at least one of the two parameters is of the type float, the input image Imageimageimage is transformed with both the next larger and the next smaller odd mask size, and the output image ImageMaximageMaximage_max is interpolated from the two intermediate images. Therefore, note that gray_dilation_shapeGrayDilationShape returns different results for mask sizes of, e.g., 44 and 4.04.0!

In case of the values β€˜rhombus’ and β€˜octagon’ for the MaskShapemaskShapemask_shape control parameter, MaskHeightmaskHeightmask_height and MaskWidthmaskWidthmask_width must be equal. The parameter value β€˜octagon’ for MaskShapemaskShapemask_shape denotes an equilateral octagonal mask which is a suitable approximation for a circular structure. At the border of the image the gray values are mirrored.

AttentionπŸ”—

Note that gray_dilation_shapeGrayDilationShape requires considerably more time for mask sizes of type float than for mask sizes of type integer. This is especially true for rectangular masks with different width and height!

gray_dilation_shapeGrayDilationShape can be executed on OpenCL devices. In case of mask sizes of type float the result can vary slightly from the CPU as the interpolation is calculated in single precision on the OpenCL device.

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* / uint2*)HObject (byte* / uint2*)HImage (byte* / uint2*)HObject (byte* / uint2*)Hobject (byte* / uint2*) *allowed for compute devices

Image for which the maximum gray values are to be calculated.

ImageMaximageMaximage_max (output_object) (multichannel-)image(-array) β†’ object (byte / uint2)HObject (byte / uint2)HImage (byte / uint2)HObject (byte / uint2)Hobject * (byte / uint2)

Image containing the maximum gray values.

MaskHeightmaskHeightmask_height (input_control) extent.y β†’ (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[int, float]Htuple (double / 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: 1.0 ≀ MaskHeight

MaskWidthmaskWidthmask_width (input_control) extent.x β†’ (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[int, float]Htuple (double / 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: 1.0 ≀ MaskWidth

MaskShapemaskShapemask_shape (input_control) string β†’ (string)HTuple (HString)HTuple (string)strHtuple (char*)

Shape of the mask.

Default: 'octagon'"octagon"
List of values: 'octagon', 'rectangle', 'rhombus'"octagon", "rectangle", "rhombus"

ResultπŸ”—

gray_dilation_shapeGrayDilationShape returns 2 (H_MSG_TRUE) if all parameters are correct.

Combinations with other operatorsπŸ”—

Combinations

Alternatives

gray_dilationGrayDilation, gray_dilation_rectGrayDilationRect

See also

gray_opening_shapeGrayOpeningShape, gray_closing_shapeGrayClosingShape, gray_skeletonGraySkeleton

ModuleπŸ”—

Foundation