Short Explanation
Dilation
E = I ⊕ S
Here we iterate over every pixel and expand it according to the given structure.
Erosion
E = I ⊖ S
We iterate again over every pixel. Then we check if the structure fits into the given image. If it does we keep the images, otherwise we remove it.
Thus we make every 'blob' smaller and removing individual pixels.
Opening
E = I ∘ S = (I ⊖ S) ⊕ S
For a opening we first apply an erosion and then an dilation. This will result in individual pixel getting removed while the rest stays more or less the same
Closing
E = I ∙ S = (I ⊕ S) ⊖ S
For a closing we first apply an dilation followed by an erosion. This will result in small holes being filled.
Hit and Miss
H = I ⊗ S
Here we check weather the current pixel matches exactly what with the structure. If so the resulting pixel is filled. This can be used to detect corners when using
this structure.
Thinning
I ⊘ S = I \ (I ⊗ S)
When using
this structure and applied with all rotations, then the image gets thinner until its only a line.
Thickening
I ⊙ S = I ∪ (I ⊗ S)
Using
this structure we can thicken the image.