9-Correlation Filtering

Section 1-Correlation Filtering-Uniform weights

So the math of what we just did is referred to as correlation or correlation filtering. And what we just did is we did it with uniform weights. So let's assume that our averaging window is size 2k plus 1 by 2k plus 1. So remember it's odd right, so if k were, were a three that would be a seven by seven. If k was one that'd be a three by three, right? So we have a odd sized window. So what we do is we're going to loop over all of our pixels around some location F of i,j, i,j being the row and column. And we loop over all the u's and all the v's going from minus k to plus k, summing up all of the pixels. And then, since we have the uniform weight right, so you have a weight of one there, we divide the whole thing by the number of weights in the filter, right? So if I had a 3 by 3 that would be 9. So if k was one, two, three. Yeah, it would be one-ninth. But that was uniform weights, and I don't know about you but I don't look any good in a uniform anymore. So,

Section 1-Correlation Filtering- Non-Uniform weights

we're going to do something totally different here. No, all we're going to do is we're going to do what are called non-uniform weights. And what that means is instead of having 1 over 2k plus 1 squared we're going to have a different weight at each location. And so these non-uniform weights are written here as H of u, v. And those are simply the weights that you're going to, still some over the whole thing, but now these different weights are going to be applied as you move around with inside that mask. This operation is referred to as correlation or the cross-correlation and I've written this here. We would say that G was the correlation or cross-correlation of H with F. So this H by the way is referred to by many things, okay? It's called a kernel, it's called the mask, it's all, it's called the coefficients. It is just the matrix of the linear weights that get used. By the way, in case any of you have taken a machine learning class, and you've turk, talked about machine learning kernels and the kernel trick. There's a sli, very very slight relation here but really it's, it's a totally different thing. We're thinking about these kernels as these masks that we do the computation. 

Last modified: Saturday, 24 February 2024, 8:11 AM