# How to simplify multiple addition and convolution operations into one convolution kernel

I need to perform such a conversion to simplify my image processing problem (sharpening, in green are the knowns, in red the unknowns):

\begin{align} y(n,m) &= \color{green}{x(n,m)} * \left[ \color{red}{f_1(n,m) + f_2(n,m)} + \color{green}{f_3(n,m)}\right]\\ &= \color{green}{x(n,m) + kx(n,m) - x(n,m) * kg(n,m)} \end{align}

Notice that the convolution done here is two-dimensional. And I know that $$f_3 = -kg ;$$ where $$k$$ is a constant. However, I could not find $$f_1$$ and $$f_2$$, I tried to use convolution Theorem to switch to FT then going back to time/spatial-domain but it did not obtain the same result. Here is a better explanation for the requested problem: To perform such a process to an input image, instead of performing the three separated steps shown in the top figure, I need to find such a kernel; let's call f where $$f = f_1 + f_2 + f_3$$ and then convolve it directly with the input image to find the same output image described in the block diagram figure. Any help/idea?

• Sorry, it's not quite clear what your given things are, and what things you are looking for. Could you state that in your question? – Marcus Müller Mar 7 '20 at 15:58
• I tried to describe it better now, my given things are x(n,m), k, and g(n,m). Things I want to find are f1,f2, and f3. – control is illusion Mar 7 '20 at 16:05

Let's rearrange \begin{align} x(n,m) * \left[ f_1(n,m) + f_2(n,m) + f_3(n,m)\right] &= x(n,m) + kx(n,m) - x(n,m) * kg(n,m)\\ x(n,m) * \left[ f_1(n,m) + f_2(n,m) \right] &= x(n,m) + kx(n,m)\\ &=(1+k)x(n,m) \end{align} It directly follows from the linearity of convolution that $$f_1+f_2=(1+k)\delta_{n,m}^{(N \times M)}$$, where $$\delta^{(N\times M)}$$ is the Kronecker delta of the same size as your input $$x$$, i.e. an all-zero matrix with a 1 in the $$0,0$$ element; the neutral element for 2D-convolution.
So, it's possible to calculate what the sum of $$f_1 + f_2$$ is, but not the individual $$f_1$$ and $$f_2$$; $$f_1= \delta^{(N\times M)}, f_2 = k\delta^{(N\times M)}$$ is as correct as $$f_1=\begin{pmatrix}1234 & 1 & \cdots &1\\0 & 0 & \cdots &0\\0 & 0 & \cdots &0\\\end{pmatrix},f_2=\begin{pmatrix}-1233+k & -1 & \cdots &-1\\0 & 0 & \cdots &0\\0 & 0 & \cdots &0\\\end{pmatrix}$$.