By analogy, mathematical morphology [1]} operators are non-linear image operators based on the spatial structure of the image. First, these operators were proposed for binary images; now, they have been extended for grayscale images.
Let \(f\)  be a grayscale image representing a function, with the intensity at position \(x\) , denoted as \(f(x)\) . The two basic operations in morphology are performed at the grey level, such that we define the erosion and dilation operations on their discrete version respectively as: \(\varepsilon _{b}(f)[n_1,n_2]= \min _{(i,j) \in \mathcal {N}} f[n_1 +i,n_2+j] - b[i,j]\)  and
\(\varepsilon _{b}(f)[n_1,n_2]= \max _{(i,j) \in \mathcal {N}} f[n_1 -i,n_2-j] + b[i,j]\) 
where \(b=\left[b_{-n} , \ldots , b_{n}\right]\)  is a structuring element (SE). In Figure REF , we observe that the dilation increases the bright areas based on the shape of the SE
leading to a brighter image.
Erosion is the morphological dual to dilation and will decrease the bright areas.
We can see a direct link between the dilation erosion and convolution where the dilation is a convolution in the max + algebra as explained in [2]}.
<FIGURE>