What method to compare of 2 matrices

594 Views Asked by At

I want to compare 2 matrices (for my character recognition project). The idea is to say that 2 matrices are "equal" if by rotation I can superpose them. For example : $$\begin{bmatrix} 0 & 255 & 255\\ 255 & 0 & 255\\ 255& 255 & 0 \end{bmatrix} = \begin{bmatrix} 255 & 255 & 0\\ 255 & 0 & 255\\ 0& 255 & 255 \end{bmatrix}$$
We can say that both matrices represent a black line on a white background and they are "equal" because we can rotate the first one to obtain the 2nd.

For example : image 1 image 2

If I rotate the first one and superpose it on the second, it's maybe 90% equal or so. So I can say that the letter I wrote corresponds to a B because it matches with the template.

I saw on wiki the correlation coefficient but I don't know if it's the solution to my problem.. Do you know any algorithm or method to compare 2 matrices in the way I want ? Thanks !

1

There are 1 best solutions below

0
On

You should use Image Processing techniques.
Something like Scale, Shift and Rotation Invariant features.

Then you should look for similarity on this feature space.