3

I'm trying to do 2d phase correlation in iOS using vDSP. I have 2 images of the same size (width and height are powers of 2). I want to do fft on both images using vDSP_fft2d_zrip and then multiply one with the conjugate of the other. how to do packing and unpacking of the real data (image) for doing real-to-complex 2d fft, using the functions vDSP_ctoz and vDSP_ztoc ?

Eran Asa
  • 31
  • 1

1 Answers1

0

I spent a few days on this problem too! I eventually found a github project by Kiran Pradeep that does an excellent job of explaining how to do this. The complex data produced by the real-to-complex FFT is in a strange format that Apple does not explain very well. The github project shows how to work with this too.

https://github.com/kiranpradeep/vDSPxcorr2D

For my project, I first used complex-to-complex, which is simpler. Using real-to-complex is about 12% faster.