The ultimate way to perform 2D FFT for image in Apple Accelerate (vDSP)

My task is to perform cross correlation for two images of arbitrary size. I've found https://developer.apple.com/forums/thread/37631 and trying to use it.

Firstly, I need to perform FFT and, to check that results are valid, I perfom IFFT to compare result of IFFT with input of FFT. I getting wrong numbers right now.

Could anyone show the right way how to do this for images?
Hi,

There's an example of using 2D FFT here: [Halftone Descreening with 2D Fast Fourier Transform
](https://developer.apple.com/documentation/accelerate/halftone_descreening_with_2d_fast_fourier_transform).

s.
The ultimate way to perform 2D FFT for image in Apple Accelerate (vDSP)
 
 
Q