My overall aim is to compare the edges of two images by comparing their Fourier Transforms (FFT) and to calculate one number as a key performance indicator that describes how much they are similar to each other.
My first step was to convert the image into grayscale and fill an array with the last pixel row. The content of the array can be treated as a signal with numbers between 0 and 255.
example with size=437:
''' [193 190 186 181 175 181 177 170 164 159 158 159 160 179 175 172 164 153 152 151 142 123 169 165 166 170 171 168 166 167 170 173 174 175 166 167 ... 69 98 52 88 83 52] '''
Is it right that when two FFTs are compared, the coherence should be used as a statistical instrument?
The coherence is calculated by dividing the cross-spectral density between the two signals x and y by the product of their auto-spectral density. The Wiener–Khinchin theorem states that the power spectral density of a stationary random process is the FFT of the corresponding autocorrelation function. So by applying the coherence function onto my signal arrays (containing the grayscale pixel information), I automatically apply a FFT onto my signal?
The coherence is a number defined between 0 and 1 and describes the correlation between two signals. The function matplotlib.mlab.cohere(x, y) returns two arrays: The frequencies for the elements in Cxy and the coherence vector. How do I get one key performance indicator out of my coherence vector?
Could someone please explain the parameters for the matplotlib.mlab.cohere(x, y) function so that I can apply them correctly?
Must the two signals have the same size?
I will be thankful if someone can answer even one of the questions.