I'm currently studying for an exam in image processing and stumbled upon a exercise which i could not answer and my professor will not be available before the exam anymore. The exercise goes as follows:
Create a Hann-lowpass kernel of size $3\times 3$ and calculate the result of the convolution at $(2,2)$ in the image.
The given solution for the filter kernel is shown below, but I do not understand how he got there:
$$ A = \frac{1}{4} \begin{pmatrix} \frac{1}{4} & \frac{1}{2} & \frac{1}{4} \\ \frac{1}{2} & 1 & \frac{1}{2} \\ \frac{1}{4} & \frac{1}{2} & \frac{1}{4} \\ \end{pmatrix} $$
The second part of the question is a simple convolution with the image which I'm able to do. The factor in front of the kernel is given by the constraint $ \sum A = 1$ to achieve a filter gain of one. I've done literature research but none of the books in the library do explain how to calculate such a kernel. The professor gives a "hint" in his presentation pointing to the generalized cosine window with $A = 0.5$, $B = 0.5$ and $C = 0$:
$$ w_k = A - B\cdot \cos\left(2\pi\frac{k}{K-1}\right) + C\cdot \cos\left(4\pi\frac{k}{K-1}\right) $$
Yet I cannot derive the final kernel from the given formulas. Can anyone give me a step by step solution for the problem?