OpenCV-Python is a Python library explicitly designed to solve computer vision problems. Morphological transformations are some simple operations based on the image shape. It is usually performed on binary images. There are two main morphological transformations.

  1. Image Dilate
  2. Image Erosion

OpenCV-Python provides the cv2 module that supports the following two functions.

  1. cv2.dilate()
  2. cv2.erode()

Python cv2 erode()

To perform erosion on images, use cv2.erode() method. The erode() is generally performed on binary images. The erode() method requires two inputs; one is an input image, and the second is called a structuring element or kernel, which decides the nature of the operation.

Syntax

cv2.erode(src, kernel[, dst[, anchor[, iterations[, borderType[, borderValue]]]]])

#python #python cv2 erode #opencv-python

Python cv2 erode: How to Erode Images using OpenCV
13.00 GEEK