本文介绍了使用Apple Accelerate框架选择实数和复杂2D FFT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以建议要使用的正确FFT(实数或复数)吗?我在此处进行了查找,但仍然有疑问.

Can anyone advise on the correct FFT to be using (Real or Complex)? I have looked here but still have questions.

我想进行图像关联以识别主图像中子图像的位置.我了解FFT和iFFT的基础.

I want to do image correlation to identify the location of a sub image within a master image. I understand the basics of FFTs and iFFTs.

计划:

  1. 在主图像上执行FFT. 512x512
  2. 获取子图像的复共轭.
  3. 在子图像上执行FFT. 30x30,但用零填充到512x512
  4. 将两个结果矩阵相乘
  5. 对结果执行iFFT
  6. 即使结果(大部分)是真实的,也要取所得矩阵的大小
  7. 寻找应该与最大相关性对应的最大值.

我无法获得预期的结果.

I am having trouble getting the results that I anticipate.

如果我使用真正的2d fft(vDSP_fft2dzrip),则结果采用打包格式,这使得使用vDSP_zvmul很难将其乘以两个结果矩阵.

If I use the real 2d fft (vDSP_fft2dzrip), the result is in a packed format that makes it hard to use a vDSP_zvmul to multiply to two result matrixes.

如果我使用复杂的fft(vDSP_fft2dzip),则根本无法获得任何关联.

If I use the complex fft (vDSP_fft2dzip), I fail to get any correlation at all.

除了反向运算外,苹果示例和大多数音频示例对正向FFT的结果没有任何作用.

The apple examples and most of the audio examples don't do anything with the results of the forward FFT other than do the inverse.

有人可以帮助我开始图像关联吗?第一个问题...我可以使用复杂的FFT并避免打包格式吗?

Can anyone help me get started with image correlation? First question...can I use the complex FFT and avoid the packed format?

推荐答案

实数FFT与复数FFT之间的唯一区别是,通过使用将2 ^ n实数FFT转换的巧妙打包方案,实数FFT的效率可能会略高一些.进入2 ^(n-1)复数FFT.在两种情况下,结果应相同.因此,如果您是我,我会坚持使用复杂的FFT来简化操作,至少要等到一切正常为止.

The only difference between a real and complex FFT is that the real FFT can be slightly more efficient by using a clever packing scheme that transforms a 2^n real FFT into a 2^(n-1) complex FFT. The results should be the same in both cases. So I would stick with the complex FFT for simplicity if I were you, at least until you have everything working.

您还看过vImageConvolve_ARGB8888吗?似乎可以轻松完成您要尝试的工作:)

Have you also taken a look at vImageConvolve_ARGB8888? It seems to do what you are trying to do, with a lot less effort :)

这篇关于使用Apple Accelerate框架选择实数和复杂2D FFT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 11:15