Question

I have a large 3D matrix and a small 3D matrix which I want to use 3D fft based convolution to find the best match for my small 3D matrix in the larger matrix. Do you have any code in C++ that can do it?

Was it helpful?

Solution

Stackoverflow is no community where one can request a code then gets it done by us, yet we can help you find the necessary resources and information so you are able to do so for yourself (usually questions on how to use libraries and help on specific topics are ok).

Let's come to your question: you already mentioned that you want to use FFT which is by far the best approach - a suitable library would be FFTW, so please take a look at it and keep the following things in mind:

  • To improve performace try to pad to powers of two which will speed up the process a lot!
  • Using real FFT and not complex will simplify and speed up this, too.
  • Usually single precision should be enough to achieve the desired results.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top