I am trying to understand how to calculate kernel matrix for guided image filter. Following is the formula for kernel calculation.
where k is window withing pixels i and j belong i assumed that window k is a 3x3 matrix and take following I matrix to calculate kernel. omega is total number of pixels in window.
I am confused about index i and j so if I take a matrix 3x 3 that is as
$$
I= \begin{matrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9 \\
\end{matrix}
$$
now mean is 5 and variance is 6.67 taking epsilon as 0.002 and omega is 9 I calculated value for kernel for the first pixel so taking i = pixel(1,1) and all rest will be j including i== j case. then my output came as (I used excel sheet to do this I could have used MATLAB)
$$ W= \begin{matrix} 0.111 & 0.111 & 0.111\\ 0.111 & 0.111 & 0.111 \\ 0.111 & 0.111 & 0.111 \\ \end{matrix} $$
when I changed values in matrix I output was still same so I doubt i understood something really wrong. Is there anyone who can explain me how to calculate W in this formula. Most confusing term for me is that sum of k:(i,j) over window k. If anyone can explain me I guess I will be able to correct my calculation.
Reference
The paper - Guided Image Filtering (Available on Scribd).
Please check section 3.3 for kernel formula.