I don't know if I am posting in the correct place. I wanted to ask about dilation and erosion in bitmaps. I have as a homework to implement in a programming language these morphological operations but I fail in understanding how they work. I know that erosion will shrink an object and dilation will enlarge it.
For example I have $$A=\matrix{0 &1 &0 &1 & 1\\ 0 &1 &0 &1 & 0\\ 0 &1 &1 &1 & 0\\ 0 &1 &1 &0 & 0\\ 0 &1 &1 &1 & 0},\; se=\matrix{1 &0 &0\\ 1 &1 &0\\ 0 &0 &1}$$
What would be the eroded and dilated output and how to compute it step by step?