# Erosion compotition rule $\left ( f \ominus g \right ) \ominus h = f \ominus \left (g \oplus h \right )$

I want to prove that erosion of a signal by a function $$g$$ followed by erosion with another function $$h$$ is equivalent to erosion of the signal by the dilation of the two functions (Erosion property):

$$\left ( f \ominus g \right ) \ominus h = f \ominus \left (g \oplus h \right )$$

My approach:

By definition of erosion we get that: $$\left ( f \ominus g\right )(x) = ⋀_{y} f(x+y)-g(y)$$

So, we get that $$\left ( f \ominus g \right ) \ominus h = ⋀_{y}\left ( ⋀_{z} f(x+y+z)-g(y)-h(z)\right )$$

Is my approach correct so far? And if yes, how do I go on?

Morphological Erosion is not associative as dilation. Much like addition is associative but not subtraction. Consider the following basic definitions first:$$(A \ominus B)^C = A^C \oplus \widetilde{B} \tag{1}$$ $$(A \oplus B)^C = A^C \ominus \widetilde{B} \tag{2}$$

where $$\widetilde{B}$$ is the reflection of kernel $$B$$ and $$A^C$$ is the compliment of image $$A$$, inverse of image $$A$$. Now let us evaluate the expression in the question: $$(A \ominus B) \ominus C = ((A\ominus B)^C \oplus \widetilde{C})^C \tag{using eq. 1}$$

$$(A \ominus B) \ominus C = ((A^C\oplus \widetilde{B}) \oplus \widetilde{C})^C \tag{using eq. 1}$$

$$(A \ominus B) \ominus C = (A^C \oplus (\widetilde{B} \oplus \widetilde{C}))^C \tag{since dilation is associative}$$

$$(A \ominus B) \ominus C = A \ominus \widetilde{(\widetilde{B} \oplus \widetilde{C})} \tag{using eq. 2}$$

$$(A \ominus B) \ominus C = A \ominus (B \oplus C) \tag{distributing the reflection}$$

• Thanks for your answer!However, in this case the dilation and erosion operators apply on sets and not on functions, where the definitions are slightly different as far as I am concerned. Could you adjust your answer so that it contains functions $f,g,h$ instead of sets $A,B,C$ , since I don't think I can just simply replace sets with functions. Apr 22, 2020 at 8:46
• Functions are nothing but sets, when you consider their range space or domain as a set of collection of points. For ex: if the range space of a function is A in $\mathbb{R}^N$, the complement set is $\mathbb{R}^N$ -A Apr 22, 2020 at 8:55
• In my case,functions represent grayscale images. Can I just replace $A,B,C$ with $f,g,h$ as simple as that: $A \rightarrow f$, $B \rightarrow g$ and $C \rightarrow h$ and be valid with these properties? Apr 22, 2020 at 8:59