I have two images given below and I want to apply same morphological operation to both of them to achieve the result image.
original image