Classical Computer Vision: The Spatial Domain II - Morphological Transformations
M orphological Transformations are simple operations generally applied to binary images using convolution as a base to transform the image. T here are two basic operations: erosion and dilation. The other morphological transformations are a composition of those two operations and the image itself. Erosion The basic idea of erosion is to "erode" away the boundaries of the "white" image. It works by trying to expand the black area, consuming the foreground image edges. So, all the pixels near boundary will be discarded depending upon the size of kernel. import numpy as np import skimage import skimage . io as io from skimage . color import rgb2gray from skimage . morphology import erosion import matplotlib . pyplot as plt import cv2 if __name__ == '__main__' : image = skimage .util.invert( rgb2gray ( io . imread ( 'plate.png' ))) plt . imshow ( image , cmap = 'gray' ) plt . show () k...