I am working on a Fourier Ptychography problem. My research problem requires me to shift the Fourier spectrum of an image by a floating-point value. For a real-valued image, we can simply use
cv2.warpAffine to shift the image by floating-point values (aka subpixel shifting).
Taking fourier transform of an image produces a complex matrix. The problem is,
cv2.warpAffine does not support complex matrices, and so I cannot use it on them. I tried searching for alternatives, but none of them seem to work. I came across
numpy.roll, but the problem is, it does not support subpixel shifting. Rounding off the shifting values translates to loss of information in my case. Is there a solution in python, that allows for subpixel shifting on complex matrices?
EDIT: Based on Marcus' answer, I did some digging and implemented a nifty little script for subpixel shifting in python based on a Matlab script for the same.
Here's the link to the script. Hope it helps!