I'm trying to compare if two pictures are similar or close to similar. The picture is available as numpy.ndarray and contains of 28x28 pixels. It might look like the one below:
When I get the image as numpy.ndarray
and calculate the corrcoef
image = data['test_dataset'][0]
matrix = np.corrcoef(image, image)
I was expecting a matrix full of 1
's. Instead I get as print(matrix)
something like:
[[ 1. 0.88450496 0.71112943 ..., 0.38349944 0.86398242
0.95855052]
[ 0.88450496 1. 0.85582039 ..., 0.60284577 0.99192916
0.85438787]
...
Afterwards I wanted to create the .mean()
of the matrix and if the value is higher than for example 0.98
the images are similar.
Can someone help me getting a matrix full of 1
's instead of my strange looking output? Thanks in advance.