How can I represent the calculation in this image mathematically?
For example, with the discrete convolution (and Fourier Transform?),
$$(f * g)[n]\ \stackrel{\mathrm{def}}{=}\ \sum_{m=-\infty}^\infty f[m]\, g[n - m]$$
Computational Science Stack Exchange is a question and answer site for scientists using computers to solve scientific problems. It only takes a minute to sign up.
Sign up to join this communityHow can I represent the calculation in this image mathematically?
For example, with the discrete convolution (and Fourier Transform?),
$$(f * g)[n]\ \stackrel{\mathrm{def}}{=}\ \sum_{m=-\infty}^\infty f[m]\, g[n - m]$$
From the computational point of view, each element of the final matrix (resulting image) is equal to a operation between the around elements in the initial matrix (input image) and the respective elements of the kernel, so:
$ final_{i,j} = \\ initial_{r(i-1),r(j-1)} OP kernel_{1,1} + initial_{r(i),r(j-1)} OP kernel_{2,1} + initial_{r(i+1),r(j-1)} OP kernel_{3,1} + \\ initial_{r(i-1),r(j)} OP kernel_{1,2} + initial_{r(i),r(j)} OP kernel_{2,2} + initial_{r(i+1),r(j)} OP kernel_{3,2} + \\ initial_{r(i-1),r(j+1)} OP kernel_{1,3} + initial_{r(i),r(j+1)} OP kernel_{2,3} + initial_{r(i+1),r(j+1)} OP kernel_{3,3} \\ $
where the $r(x)$ represents the integer division between the x and the matrix side.