In the previous article, the Opening operator was specified which was applying the erosion operation after dilation. It helps in removing the internal noise in the image. Closing is similar to the opening operation. In closing operation, the basic premise is that the closing is opening performed in reverse. It is defined simply as a dilation followed by an erosion using the same structuring element used in the opening operation.
Syntax: cv2.morphologyEx(image, cv2.MORPH_CLOSE, kernel)
-> image: Input Image array.
-> cv2.MORPH_CLOSE: Applying the Morphological Closing operation.
-> kernel: Structuring element.
Below is the Python code explaining Closing Morphological Operation –
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.