# How would the correlation coefficient between 2 images change if we rotated 1 image?

Suppose we have a image which is represented by a matrix

$$\begin{bmatrix} a & b & c \\ d & e & f \\ g & h & i \\ \end{bmatrix}$$

and we want to find its correlation with another image:

$$\begin{bmatrix} 1 & 2\\ 3 & 4\\ \end{bmatrix}$$

Now the correlation can be found by taking the mirrored matrix of the convolution of the 2 matrices.And we end up with a correlation coefficient which tells us how alike are the images.

Suppose we rotate the first image using the 3x3 rotation matrix and find the correlation coefficient between the rotated image and the above image.Now how much will the correlation coefficient change for a rotation at a angle $$\theta$$?Is there a minimum or a maximum?Can we calculate the function $$f(\theta)$$ which gives the percentage change in the correlation coefficient?

• That would fully depend on both matrices. Commented Sep 27, 2023 at 10:13
• “the correlation can be found by taking the mirrored matrix of the convolution of the 2 matrices” No, it’s the convolution of one matrix with the mirror of the other. You have to mirror one of the inputs, not the output. Commented Sep 27, 2023 at 14:21
• I didn't watch the video, but the equations shown at the start show exactly what I'm saying. The u and v have a minus in one input for the convolution but not for the correlation. That means that that input is mirrored in one operation wrt the other operation. The other input has the same signs for u and v in both operations, so that one doesn't get mirrored. Commented Sep 27, 2023 at 16:08
• He's talking about traversing the F input, not the output. Commented Sep 27, 2023 at 16:40

You will hence need look at your individual matrices, and calculate that function $$f_{P,M}(\theta)$$ for every pair of matrices $$P$$ and $$M$$ that you care about. Luckily, the correlation coefficient has a simple form (it's but a sum of products), and the rotation, too, so that you can just write that out, in case you plan to exploit any specific properties of the matrices that you might know.
• You know what?I am asking this question because I believed that if we want to compare 2 images of apples and 1 of them is rotated , due to the rotation of the 1 image we could introduce a error margin on the maximum of $f_{P,M}(\theta)$.I am suprised it hasnt been studied extensively. Commented Sep 27, 2023 at 16:38