erosion_dialation kernel is used such as 5x5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 in erosion have to match all value in kernel with input image. in dialation have to match any value in the kernel with input value . input image output erosion output dialation