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.
OpenCV-Python provides the cv2 module that supports the following two functions.
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.
cv2.erode(src, kernel[, dst[, anchor[, iterations[, borderType[, borderValue]]]]])
#python #python cv2 erode #opencv-python