Speed up DFT by specifying ROI in frequency domain [closed]

asked 2018-05-21 03:26:55 -0600

masahiro.dll gravatar image

updated 2019-08-15 00:30:48 -0600

Note: This question is also asked at Stack Overflow a couple of days later since this post.

I'm building an application which extensively use dft, discrete Fourier transform. I'm trying to speed up so as to run in real-time.

In that application I only use a part of dft output specified by a rectangular ROI. My current implementation follows the steps below:

  1. Compute dft of the input image f (typically size of 512x512) and get the entire dft result F
  2. Crop F into a pre-specified ROI (typically size of 32x32, located arbitrary), R

This process basically works well, but involves useless calculation since I only need partial information of F. I'm looking for a way to accelerate this calculation only by computing necessary part of dft.

I found OpenCV with Intel IPP computes dft with Intel IPP functions, which results in an order of magnitude faster than naive OpenCV implementation. I'm wondering if I can even accelerate this computation by only computing necessary frequency domain of dft.

Since I'm new to OpenCV, I've lost my way here, so I hope you could provide a way to do this.

Kindly note that I don't mean to do a dft to an ROI of an image, i.e. dft(ROI(f)), but I want to compute ROI(dft(f)).

Thanks in advance.

EDIT: I've got a nice answer on Stack Overflow. Refer to the URL as pointed in the main text.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by StevenPuttemans
close date 2019-08-19 09:19:35.004392