In my Image Processing course, I had to operate a filter on image. Mathematically it's a convolution between the image $A$ (matrix $M\times N$) and a filer $F$ (matrix $m\times n$): $$ A\star F $$ The output is given by: $$ G(i,j)=\sum_{u=-k}^k\sum_{v=-k}^k A(u,v)F(i-u,j-v) $$ It made my wonder - what is the size of $G$ matrix? I thought that maybe it should be $(2k)\times(2k)$ but it's not the case.
For example, for: $$ A=\begin{bmatrix}9 & 9 & 18\\ 27 & 54 & 18\\ 18 & 9 & 27 \end{bmatrix}\quad F=\frac{1}{9}\begin{bmatrix}-1 & -1 & -1\\ -1 & 17 & -1\\ -1 & -1 & -1 \end{bmatrix} $$ We get matrix $5\times 5$. What is the formula? I guess we need to count it?