I used the Accord Framework to perform 2D cross-correlation in C#, hence applying this formula : corr(a, b) = ifft(fft(a_and_zeros) * conj(fft(b_and_zeros)))
.
My output data are stored in a Complex[,] object, but the zero frequency component is shifted towards the top-left corner of the matrix, which is expected.
I have done the same thing with MATLAB previously and I used the fftshift
function to re-center it. I, Alas, couldn't find any equivalent function in the Accord Framework to work with my C# code.
Is there a way to do it that would be more elegant than copying each quarter of the matrix in new matrixes and reorganizing them into the original matrix?