Erosion operation

The main effect of an erosion operation on a binary image is to gradually erode away the boundary regions of the foreground object. This means that the areas of the foreground object will become smaller, and the holes within those areas will get bigger. You can see the details of this operation in the following code:

erosion = cv2.erode(image, kernel, iterations=1)