A string corresponding to the name of a morphological
operation to apply to the image (see Note).
kernel
A binary matrix. If the matrix is not binary, all positive values
will be automatically converted to 1, all negative values to 0, unless
operation = "hitmiss" in which case they will be converted to -1.
k_shape
A string corresponding to the shape of the kernel for the
morphological operation (see Note; default: "rectangle"). Ignored if a
custom kernel is provided.
k_height
The half-height in pixels of the kernel. Ignored if a custom
kernel is provided.
k_width
The half-width in pixels of the kernel. Ignored if a custom
kernel is provided.
iterations
The number of times the morphological operations should be
applied.
in_place
A logical indicating whether the change should be applied to
the image itself (TRUE, faster but destructive) or to a copy of it (FALSE,
the default, slower but non destructive).
Value
An Image object if in_place=FALSE. Otherwise, it
returns nothing and modifies image in place.