I am trying to do the correlation analysis for grayscale images and their ciphers in Python or MATLAB. But I don't understand how to code the same. Also, I didn't get any function or existing code for the same.
If you're trying to calculate the correlation between various images in a statistical sense then you need to take the mean of your images in the high-dimensional space. and then use the concept of correlation to identify how closely related two images are.
But if its the correlation matrix you're trying to consider the following code would be useful:
from scipy import signal
cor = signal.correlate2d (im1, im2)
where im1 and im2 are the two images
But if you're trying to look at the similarity or difference between two images I would suggest that you should implement something like the triplet loss