Pregunta

Can I expect a speedup when using FFTW (http://www.fftw.org/) instead of OpenCV's cvDFT (http://goo.gl/YCHj0)?

My program's runtime is heavily determined by the application of inverse and forward DFT and I am thinking about using FFTW instead of OpenCV cvDFT.

IIRC FFTW does some kind of "runtime compilation" whereas cvDFT is a simple FFT implementation, so I guess it could speed up my processing a bit.

So before I am trying it out by myself, I thought to ask in here in case anyone stumbled over the same question and solved it before.

Thanks in advance

¿Fue útil?

Solución

I have used both (OpenCV and FFTW) and you can expect FFTW to be faster than the simpler implementation in OpenCV (how much depends a lot on your processor and image sizes of course). However, if you plan on using your software commercially FFTW has a rather expensive license ($7500.00). In the commercial case, I would recommend Intel's IPP over FFTW as the performance is similar with a much more affordable license ($199.00) + you get way more functionality in IPP than you do with FFTW (i.e., only an FFT library).

Here are several benchmarks between FFTW and various competitor libraries. The results are kind of old, but are useful for comparison. I'm not sure why the IPP 2D transforms are not included (maybe when these benchmarks were done they didn't exist yet).

If you go the IPP route, you can build OpenCV with IPP support and it will swap out the native cvDFT implementation with the IPP equivalent. This will give you a nice performance boost (particularly on Intel chips), and you don't have to change your code.

Otros consejos

A more up to date and pretty well done comparison between several FFT options, there are pretty fast and free options:

https://github.com/project-gemmi/benchmarking-fft

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top