# What is the betwwen [i,j] and [u,v] in explinations of correlation and convolution (picture attached)?

I don't know how to write 'summation' symbol here hence posting the picture.

Can someone explain to me the difference between i,j and u,v in this explanation of correlation and convolution?

I know this discussion must have taken place somewhere but it is difficult to look for such discussion by keyword 'correlation' and convolution'.

I have already referred to the following posts: 1. Difference between correlation and convolution on an image? 2. What is the difference between convolution and cross-correlation?

Adding the source for reference: https://www.youtube.com/watch?v=C3EEy8adxvc Thank you in advance.

• You can write TeX (or TeX-alike) code directly in your question! $\sum a^2 becomes$\sum a^2$, and $$\sum_{a=0}^{100} a^2$$ becomes $$\sum_{a=0}^{100} a^2$$. Try it out! also, youtube videos are usually not the best source to find information about math subjects – I've found several ones that are plain wrong but had literally millions of views. – Marcus Müller Mar 11 '19 at 8:25 • Not quite sure what you're asking, though.$u$and$v$are the indices of the summation, whereas$i,j\$ are the point at which you evaluate your convolution and correlation. – Marcus Müller Mar 11 '19 at 8:26
• Thanks @MarcusMüller I was confused as to what these symbols are representing. I go the answer now. Much appreciated. – Sulphur Mar 25 '19 at 19:48

## 2 Answers

$$[i,j]$$ are your spatial coordinates and $$[u,v]$$ are summation indices.

The difference between correlation and convolution is simply the sign: correlation has $$i+u$$ and convolution has $$i-u$$.

They are close cousins: it's easy to express one as a function of the other. For example: correlation is the same as convolution with a properly mirrored/flipped version of the kernel. If the kernel is sufficiently symmetric, both correlation and convolution will yield the same result.

I believe i,j is the coordinates of the center of the kernel (in image space), and u,v are the offsets from that center. So in the example, he has placed the kernel at an i,j of 0,0. That is, the kernel is centered at 0,0. Of course, one iterates each pixel (i.e. places the center of the kernel on each pixel) to apply the kernel to the image.