Implementing some basic morphological image processing operations: Erosion, Dilation, Opening, Closing