dftups

image_registration.fft_tools.dftups(inp, nor=None, noc=None, usfac=1, roff=0, coff=0)[source]

Translated from matlab:

  • Original Source

  • Manuel Guizar - Dec 13, 2007

  • Modified from dftus, by J.R. Fienup 7/31/06

Upsampled DFT by matrix multiplies, can compute an upsampled DFT in just a small region.

This code is intended to provide the same result as if the following operations were performed:

  • Embed the array “in” in an array that is usfac times larger in each dimension. ifftshift to bring the center of the image to (1,1).

  • Take the FFT of the larger array

  • Extract an [nor, noc] region of the result. Starting with the [roff+1 coff+1] element.

It achieves this result by computing the DFT in the output array without the need to zeropad. Much faster and memory efficient than the zero-padded FFT approach if [nor noc] are much smaller than [nr*usfac nc*usfac]

Parameters:
usfacint

Upsampling factor (default usfac = 1)

nor,nocint,int

Number of pixels in the output upsampled DFT, in units of upsampled pixels (default = size(in))

roff, coffint, int

Row and column offsets, allow to shift the output array to a region of interest on the DFT (default = 0)