[][src]Function opencv::imgproc::erode

pub fn erode(
    src: &dyn ToInputArray,
    dst: &mut dyn ToOutputArray,
    kernel: &dyn ToInputArray,
    anchor: Point,
    iterations: i32,
    border_type: i32,
    border_value: Scalar
) -> Result<()>

Erodes an image by using a specific structuring element.

The function erodes the source image using the specified structuring element that determines the shape of a pixel neighborhood over which the minimum is taken:

block formula

The function supports the in-place mode. Erosion can be applied several ( iterations ) times. In case of multi-channel images, each channel is processed independently.

Parameters

  • src: input image; the number of channels can be arbitrary, but the depth should be one of CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
  • dst: output image of the same size and type as src.
  • kernel: structuring element used for erosion; if element=Mat(), a 3 x 3 rectangular structuring element is used. Kernel can be created using #getStructuringElement.
  • anchor: position of the anchor within the element; default value (-1, -1) means that the anchor is at the element center.
  • iterations: number of times erosion is applied.
  • borderType: pixel extrapolation method, see #BorderTypes
  • borderValue: border value in case of a constant border

See also

dilate, morphologyEx, getStructuringElement

C++ default parameters

  • anchor: Point(-1,-1)
  • iterations: 1
  • border_type: BORDER_CONSTANT
  • border_value: morphologyDefaultBorderValue()