Applies morphological operations to binary images. Typically used for noise reduction and shape enhancement in thresholded images.
- A binary image. All non-zero pixels in the input image are regarded as foreground.
- The morphological operation to apply to the input.
- The size of the morphological mask (a.k.a the structuring element) in world coordinates. If the mask is bigger than the input image, the output image will be filled with zeros.
- The shape of the structuring element.
- A flag that indicates whether foreground objects on image borders are assumed to expand beyond the edge. Setting this property to
truemakes the algorithm slower.
- A binary image.