How to perform ifft2 with phase and magnitude

11 visualizaciones (últimos 30 días)
Changoleon
Changoleon el 25 de Sept. de 2016
Respondida: Walter Roberson el 26 de Sept. de 2016
Hi. I really tried to find the answer for my questions but I didn't find it online.
So I have two images which correspond to the magnitude and phase following a Fourier transform of an image. Now I want to write a function to convert the magnitude image and phase image into the original image in spatial domain. The question also states that "For the phase image, 0 corresponds to –pi and 255 corresponds to +pi. All values in between have been linearly interpolated between –pi and pi and For the magnitude image, the intensities were log-transformed prior to saving the image, where 0 corresponds to e0 and 255 corresponds to e18."
Here is what I tried:
m1 = double(imread('magnitude1.tif'));
p1 = double(imread('phaseD.tif'));
newfft = m1.* exp(1i*p1);
out = ifft2(newfft);
My problem is I don't know how to change the values from 0 to 255 to be - pi to pi.
Any ideas would be appreciated.

Respuestas (1)

Walter Roberson
Walter Roberson el 26 de Sept. de 2016
((double(p1) / 255 * 2 - 1) * pi
Or you might prefer
double(p1) / 255 * 2 * pi - pi

Categorías

Más información sobre Geometric Transformation and Image Registration en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by